Repository navigation
fix: finish setup when the /user sync fails, keeping the saved user [ENG-7681] - #94
pandeymangg wants to merge 2 commits into
Conversation
…ENG-7681] A failed /user sync at setup returned early, so setup never finished and every track was dropped until the app restarted. Keep the saved user state, push its expiry 30 minutes ahead and finish setup (ENG-7620 #9).
…t a userId [ENG-7681]
|
|
No actionable comments were generated in the recent review. WalkthroughUser-state synchronization now returns a user state directly. When synchronization fails, the saved state is retained with its expiry advanced by 30 minutes, and setup continues without returning a user-sync error. Tests cover failed synchronization, unexpired saved state, missing user IDs, and survey selection after tracking an action. Merge Risk:
|



Fixes ENG-7681
What & why
Since ENG-7265 (#93, on
main, not released), setup really syncs/userwhen the saved user state has expired. If that call failed, setup returned early: no config saved, no timers, no error state.<Formbricks />ignores the error, so everytrackwas dropped until the app restarted.Now a failed sync logs the error, keeps the saved user, pushes its expiry 30 min ahead and finishes setup. This is the agreed behaviour for all five SDKs (ENG-7620 #9).
syncUserStateIfExpiredno longer returns aResult, since it can't fail any more.pnpm api:checkpasses).userIdhas expired and/userfails.Tests (red on
main, green here)mainsetup.test.ts› finishes setup with the saved user when the user sync fails, so track can show a surveyexpected false to be trueonresult.okThe old test "returns an error when user sync fails" asserted the bug and is removed. The ENG-7265 back-off tests pass unchanged.
Lint, format, types, 231/231 tests, build,
api:check, script tests and package-check pass locally.