fix: refresh Flagsmith organisation traits when the selected organisation changes - #8485
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
📝 WalkthroughWalkthrough
Priority: ⬇️ Low — Defer the organisation trait refresh because it is a narrow frontend change limited to updating flags for the selected organisation. Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to Organisation selection now refreshes Flagsmith traits so organisation-scoped UI follows the active organisation. Rapid switching may briefly leave gated UI evaluated against a previously selected organisation until refresh ordering is guarded. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #20300 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #20300 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #20300 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #20300 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #20297 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #20297 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #20297 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #20297 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: f488fe00-558f-46e1-9d10-7a92d20aeac7
📒 Files selected for processing (1)
frontend/common/stores/account-store.js
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/common/stores/account-store.js (1)
117-118: 🗄️ Data Integrity & Integration | 🟠 MajorUpdate Flagsmith traits on direct organisation mutations.
createOrganisation,deleteOrganisation, andeditOrganisationassignstore.organisationdirectly. These paths do not callselectOrganisation, so the new trait update is bypassed. Flagsmith can retain the previous organisation'sorganisation.id,organisation.name, andsubscription.plantraits after an organisation is created, edited, or deleted. Route active-organisation changes through one shared trait-update helper, and clear the traits when no organisation remains.Also applies to: 148-151, 172-174
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 31ffb7d9-d2ae-4147-8132-73e067c5c9e3
📒 Files selected for processing (1)
frontend/common/stores/account-store.js
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
docs/if required so people know about the feature.Changes
Flagsmith traits were only sent on login, so org-scoped segments were evaluated against whichever org you logged in under.
selectOrganisationnow refreshes them viasetTraits(notidentify— keeps bucketing intact). Covers org creation too, which routes through the same action.How did you test this code?
Manually: with a flag segmented on
organisation.id, switching orgs now flips the gated UI without a refresh.