-
Notifications
You must be signed in to change notification settings - Fork 27
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
PM-11974: Fix login with device notification for inactive account not switching to that account #1157
base: main
Are you sure you want to change the base?
Conversation
… switching to that account
@@ -308,14 +307,14 @@ class DefaultNotificationService: NotificationService { | |||
let request = UNNotificationRequest(identifier: data.id, content: content, trigger: nil) | |||
try await UNUserNotificationCenter.current().add(request) | |||
|
|||
// If the request is for the existing account, show the login request view automatically. | |||
guard let loginRequest = try await authService.getPendingLoginRequest(withId: data.id).first |
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.
This API request was being made if the login request was for an active or inactive user. And it fails for an inactive user since it has the wrong access token. This instead needs to happen after switching accounts if the request is for an inactive user.
userEmail: loginSourceEmail | ||
userId: loginSourceAccount.profile.userId |
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.
This previously stored the email of the account that the request was for. Which would be problematic if there were multiple accounts with the same email. So I switched to the use the user ID.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1157 +/- ##
==========================================
+ Coverage 89.38% 89.42% +0.04%
==========================================
Files 688 688
Lines 43734 43727 -7
==========================================
+ Hits 39090 39102 +12
+ Misses 4644 4625 -19 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
No New Or Fixed Issues Found |
🎟️ Tracking
PM-11974
📔 Objective
This fixes receiving a login with device notification for an inactive account.
📸 Screenshots
ScreenRecording_11-21-2024.14-34-12_1.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes