Skip to content

fix(Onboarding): Stop refreshing the organisation store without an organisation - #9232

Open
talissoncosta wants to merge 2 commits into
mainfrom
fix/organisation-refresh-without-id
Open

talissoncosta wants to merge 2 commits into
mainfrom
fix/organisation-refresh-without-id

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to ENG-1258

Every load of the onboarding page throws an unhandled error. After setup, onboarding refreshes the organisation store, but nothing has loaded an organisation on that page yet. The store falls back to its default id 'account' and requests /projects/?organisation=account, which returns 400. Those requests sit in a Promise.all with no catch, so the failure goes unhandled. The dev server shows it as [object Response].

  • The organisation store skips a refresh when no organisation has loaded, and handles a failed load instead of leaving the rejection unhandled.
  • Onboarding refreshes using the organisation it just set up. AppActions.getOrganisation now takes force so the new project shows.

Other callers of refreshOrganisation() (EnvironmentAside, project-store, useUpdateProjectWithToast) also benefit from the guard.

Easier to review with whitespace hidden (?w=1): adding the catch re-indented the then block.

How did you test this code?

  • On localhost against the staging API, with an account that already went through onboarding:
    • Before: loading /getting-started made an unhandled rejection from GET /projects/?organisation=account (400).
    • After: no account request, the organisation refresh uses the real id, and there are no unhandled rejections.
  • /organisation/<id>/projects still lists its projects, with no rejections.
  • The onboarding unit tests pass.

@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Dec 3, 2026 4:46pm UTC
flagsmith-frontend-staging Ready Ready Preview Dec 3, 2026 4:46pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Dec 3, 2026 4:46pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

…placed organisation loads

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-9232 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-9232 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-9232 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-9232 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-9232 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-9232 Finished ✅ Results ✅

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Fixes an unhandled onboarding error by guarding organisation-store refreshes until an organisation is loaded, adding failure handling, and refreshing with the newly set organisation id. Bounded bug fix with tests; no contract or rollout changes.

Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #24113 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  52.7 seconds
commit  4832d70
info  🔄 Run: #24113 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #24113 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  8 passed

Details

stats  8 tests across 7 suites
duration  1 minute, 7 seconds
commit  4832d70
info  🔄 Run: #24113 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #24113 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.9 seconds
commit  4832d70
info  🔄 Run: #24113 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #24113 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  30.7 seconds
commit  4832d70
info  🔄 Run: #24113 (attempt 1)

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

31 screenshots compared. See report for details.
View full report

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-staging — 4832d70f Deployed Dec 3, 2026 by vercel[bot]
Preview – flagsmith-frontend-preview — 4832d70f Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant