Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition when changing teams while on the application page #4951

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

cstns
Copy link
Contributor

@cstns cstns commented Dec 19, 2024

Issue caused by setting team sequentially while on the application page. This did not pose a problem until nesting the application pages under the team namespace

Description

  • removed the team dispatch on beforeMount and beforeRouteEnter causing the issue
  • update how we change the team, updating the team is more than enough while pushing a new route for browser history consistency
  • a bit of code cleanup on the application page

Related Issue(s)

closes #4950
introduced by #4885

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

- removed the team dispatch on beforeMount and beforeRouteEnter causing the issue
- update how we change the team, updating the team is more than enough while pushing a new route for browser history consistency
- a bit of code cleanup on the application page
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.44%. Comparing base (cf9bfbe) to head (923aab4).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4951   +/-   ##
=======================================
  Coverage   78.44%   78.44%           
=======================================
  Files         325      325           
  Lines       15353    15353           
  Branches     3529     3529           
=======================================
  Hits        12043    12043           
  Misses       3310     3310           
Flag Coverage Δ
backend 78.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +83 to +87
'/team/' + this.team?.slug + '/billing',
'/team/' + this.team?.slug + '/settings',
'/team/' + this.team?.slug + '/settings/general',
'/team/' + this.team?.slug + '/settings/danger',
'/team/' + this.team?.slug + '/settings/change-type'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not simply return [] if team is not set?

As it stands, you will return at array containing '/team/undefined/billing' etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Steve-Mcl have you tested it? I can confirm this PR fixes the bug that is live in production now that we should get fixed. I don't see any ill effects because of this.

Copy link
Contributor

@Steve-Mcl Steve-Mcl Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested it?

Yes, it works well, however I only flagged this code section because the PR (on the whole) is about handling team being undefined. By the same virtue, if team IS undefined, then we will get a bunch of links to /undefined/

I am not blocking it - happy for the PR to be merged as is.

@knolleary knolleary merged commit 9c07b1b into main Dec 20, 2024
18 checks passed
@knolleary knolleary deleted the fix-race-condition-when-changing-teams branch December 20, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing teams while on the application page does not change team
3 participants