Skip to content

Fix provision logging user back out after successful sign-in#29294

Merged
chrisnojima merged 1 commit into
masterfrom
nojima/HOTPOT-fix-provision
Jun 8, 2026
Merged

Fix provision logging user back out after successful sign-in#29294
chrisnojima merged 1 commit into
masterfrom
nojima/HOTPOT-fix-provision

Conversation

@chrisnojima

Copy link
Copy Markdown
Contributor

resetState rewinds startProvisionTrigger 1->0, which subscribeValue treats as a change and re-fires onStartProvisionTriggerChanged. After a successful provision (loggedIn now true) that handler logs the just-provisioned user back out, leaving them stuck on the login screen.

Guard the handler to only run on an increment (a real provision start), ignoring the reset-to-0 rewind.

resetState rewinds startProvisionTrigger 1->0, which subscribeValue
treats as a change and re-fires onStartProvisionTriggerChanged. After a
successful provision (loggedIn now true) that handler logs the
just-provisioned user back out, leaving them stuck on the login screen.

Guard the handler to only run on an increment (a real provision start),
ignoring the reset-to-0 rewind.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an unintended logout after a successful provisioning/sign-in by preventing the “start provision” subscription handler from running when the provision store trigger is rewound during resetState/resetAllStores.

Changes:

  • Update onStartProvisionTriggerChanged to receive (value, previous) from the shared subscribeValue helper.
  • Guard the handler so it only runs when startProvisionTrigger increments (a real provision start), and ignores resets that decrease the trigger back to 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chrisnojima chrisnojima merged commit e77e818 into master Jun 8, 2026
1 of 2 checks passed
@chrisnojima chrisnojima deleted the nojima/HOTPOT-fix-provision branch June 8, 2026 18:48
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