fix: refactor login/logout flow and subscription handling#1436
Merged
fadi-george merged 4 commits intomainfrom Mar 5, 2026
Merged
fix: refactor login/logout flow and subscription handling#1436fadi-george merged 4 commits intomainfrom
fadi-george merged 4 commits intomainfrom
Conversation
b3f5179 to
3a66d99
Compare
abdulraqeeb33
approved these changes
Mar 5, 2026
abdulraqeeb33
left a comment
There was a problem hiding this comment.
Discussed about the PR in detail via chat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
1 Line Summary
Addresses: https://app.asana.com/1/780103692902078/project/1208777190614537/task/1213469123238681
Refactor login/logout to share a common user-switching path and create an empty push subscription on login so accepting permissions later patches instead of creating a second user.
Details
_switchUserand_resetAndGetIdentityModelinLoginManagerto DRY up_loginand_logoutcreateUserOnServerintopage.tsascreateSubscribedUser, scoped to where it is actually used, accepting the push model directly to avoid redundant lookupsresetUserModelsintoLoginManagerand deleteduserDirector.tshasCssClassandwaitForAnimationsfromdom.tsconsole.logcallsSystems Affected
Validation
Tests
Updated tests in
LoginManager.test.tsandOneSignal.test.tsto match the new behavior where login creates an empty subscription upfront and permissions acceptance triggers a subscription update.Login flows
User created & fake sub created:
Two users now:
Logout flows
Before logout:
After logout (no errors):


Before logout:
After logout:

Anonymous user flows (no login)
Edge cases
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of arraysyntax. PreferforEachor usemapcontextif possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.contextScreenshots
Info
No UI changes.
Checklist
Related Tickets
Made with Cursor
This change is