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

Bugfix: wait for settings loading before onboarding redirect check #5470

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

franknoirot
Copy link
Collaborator

@franknoirot franknoirot commented Feb 24, 2025

If you refresh the app while viewing a file, the settingsActor could not have loaded the user settings before checking the onboardingStatus setting. This uses a useEffect to subscribe to navigation events and trigger navigation to the onboarding if necessary. It adds a TODO comment with the approach that should be taken once router data and methods can be slotted into the appMachine and the navigation can occur after the user settings are loaded, without needing to touch React.

If you refresh the app while viewing a file, the settingsActor could not
have loaded the user settings before checking the onboardingStatus
setting. This uses a subscription on the settingsActor to await the
"init" state, after the user settings have loaded.
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Feb 24, 2025 8:35pm

Copy link

qa-wolf bot commented Feb 24, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.02%. Comparing base (484da28) to head (a67bacb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5470   +/-   ##
=======================================
  Coverage   86.02%   86.02%           
=======================================
  Files          95       95           
  Lines       35754    35754           
=======================================
  Hits        30757    30757           
  Misses       4997     4997           
Flag Coverage Δ
wasm-lib 86.02% <ø> (ø)

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.

@franknoirot
Copy link
Collaborator Author

@pierremtb pointed out some major flaws with the current approach, and upon reflection this is not at all the way to do this. The function for the loader will have already returned with null by the time the subscribe callback runs, leading to this sort of zombie closure using the redirect functionality incorrectly. I'm going to rework it to redirect elsewhere, further moving us away from using routeLoaders which have always given us trouble anyways.

@franknoirot franknoirot force-pushed the franknoirot/adhoc/dont-redirect-unless-settings-loaded branch from 16b9b78 to 4356b2b Compare February 24, 2025 19:43
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.

2 participants