-
-
Notifications
You must be signed in to change notification settings - Fork 45
Login: App switching fix #3417
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
Login: App switching fix #3417
Conversation
…ating the previous app again).
📝 WalkthroughWalkthroughThe change modifies how the Sequence DiagramsequenceDiagram
participant User
participant UI as LoginActivity UI
participant LoginActivity
participant OnResume as onResume Flow
User->>UI: Select app (spinner or drawer)
UI->>LoginActivity: onItemSelected or handleDrawerItemClick
rect rgb(200, 220, 255)
Note over LoginActivity: NEW: Set presetAppId = appId/recordId
LoginActivity->>LoginActivity: presetAppId = selectedAppId
end
User->>LoginActivity: Activity resumed
LoginActivity->>OnResume: onResume() called
rect rgb(220, 240, 220)
Note over OnResume: Uses presetAppId for connect/login
OnResume->>OnResume: Proceed with auth using presetAppId
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
conroy-ricketts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the simple fixes!
|
@OrangeAndGreen Changes LGTM but just a question: This bug arises due to switching of app from side navigation? We have not faced this issue previously. |
|
@Jignesh-dimagi Yeah, this behavior would only arise in the special occasion where the Login page was launched with a presetAppId and then the user tried to switch via the side menu. The page would seat the app that the user chose, but then immediately reseat the previous app since it was specified as the preset when the activity was launched. |
https://dimagi.atlassian.net/browse/CI-370
Product Description
Fixes a bug that could prevent a user from switching to a different app on the login page.
Technical Summary
Once the login page was launched with a presetAppId, it would no longer be possible to seat a different app.
If the user attempted to do so, the app would seat the new app and then immediately seat the preset app again.
When the user selects a new app, the code now updates the presetAppId to match the user's new selection (the original selection that brught us to the page no longer matters).
Feature Flag
None
Safety Assurance
Safety story
I tested before and after the fix and verified that the UX is as desired.
Automated test coverage
None
QA Plan
-Login to an app
-Use the side drawer to select a different app from the menu
-On the login page, choose a different app rather than logging into the previously selected app
-Observe that the new app is seated correctly and the code doesn't re-seat the previous app.