Skip to content

fix(frontend): gate app boot on ConfigStore.hasLoaded to avoid loader deadlock#7785

Merged
talissoncosta merged 2 commits into
mainfrom
fix/e2e-prod-flakiness
Jun 15, 2026
Merged

fix(frontend): gate app boot on ConfigStore.hasLoaded to avoid loader deadlock#7785
talissoncosta merged 2 commits into
mainfrom
fix/e2e-prod-flakiness

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Changes

Fixes the intermittent E2E failure blocking the production deploy gate: the app booting into a permanent loader.

ConfigProvider derived isLoading from ConfigStore.model, which is never populated, so it always started loading and relied on the store's one-shot change event to release it. If the Flagsmith SDK's onChange fired before componentDidMount subscribed, that event was lost — and with realtime/events disabled in E2E, nothing recovered it, so the app stuck on the loader.

  • Gate the initial state on ConfigStore.hasLoaded instead of model.
  • Re-read the store after subscribing, so an event in the constructor→subscription gap can't strand the boot.

How did you test this code?

Forced the race (delayed the subscription so onChange always lands in the gap) and loaded /login on 15 fresh contexts: main 15/15 stuck on the loader, this fix 0/15.

talissoncosta and others added 2 commits June 15, 2026 09:27
ConfigStore.model is never populated (getAllFlags() returns nothing at
the point config-store assigns it), so the provider always started in
the loading state even when the store had already finished loading.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The SDK's onChange can fire between the constructor reading the store
and componentDidMount subscribing to it. In E2E mode realtime, events
and analytics are disabled, so the missed event left the app on the
boot loader indefinitely. Re-read the store after subscribing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@talissoncosta talissoncosta requested review from a team as code owners June 15, 2026 12:28
@talissoncosta talissoncosta requested review from kyle-ssg and removed request for a team June 15, 2026 12:28
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jun 15, 2026 1:00pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 15, 2026 1:00pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 15, 2026 1:00pm

Request Review

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

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

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (6729d6a) to head (2e8b274).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7785   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files        1460     1460           
  Lines       56459    56459           
=======================================
  Hits        55652    55652           
  Misses        807      807           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.3 seconds
commit  2e8b274
info  🔄 Run: #17500 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.8 seconds
commit  2e8b274
info  🔄 Run: #17500 (attempt 1)

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

passed  3 passed

Details

stats  3 tests across 3 suites
duration  41.2 seconds
commit  2e8b274
info  🔄 Run: #17500 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  56.1 seconds
commit  2e8b274
info  🔄 Run: #17500 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  40.8 seconds
commit  a6bb897
info  🔄 Run: #17503 (attempt 1)

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

passed  1 passed

Details

stats  1 test across 1 suite
duration  45 seconds
commit  a6bb897
info  🔄 Run: #17503 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.8 seconds
commit  a6bb897
info  🔄 Run: #17503 (attempt 1)

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

passed  2 passed

Details

stats  2 tests across 2 suites
duration  56 seconds
commit  a6bb897
info  🔄 Run: #17503 (attempt 1)

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

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

@talissoncosta talissoncosta force-pushed the fix/e2e-prod-flakiness branch from 2e8b274 to a6bb897 Compare June 15, 2026 12:59
@github-actions github-actions Bot added fix and removed fix labels Jun 15, 2026
@talissoncosta talissoncosta changed the title fix(frontend): resolve E2E flakiness blocking the production deploy gate fix(frontend): gate app boot on ConfigStore.hasLoaded to avoid loader deadlock Jun 15, 2026
@talissoncosta talissoncosta merged commit 3965016 into main Jun 15, 2026
31 checks passed
@talissoncosta talissoncosta deleted the fix/e2e-prod-flakiness branch June 15, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants