-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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-7926] Handle complex user logout events #9115
Conversation
Split up done logging out and navigation so we can always display expire warning.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9115 +/- ##
==========================================
+ Coverage 27.70% 27.79% +0.08%
==========================================
Files 2418 2422 +4
Lines 70019 70266 +247
Branches 13052 13102 +50
==========================================
+ Hits 19401 19531 +130
- Misses 49106 49215 +109
- Partials 1512 1520 +8 ☔ View full report in Codecov by Sentry. |
Fixed Issues
|
apps/browser/src/platform/services/abstractions/abstract-chrome-storage-api.service.ts
Show resolved
Hide resolved
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.
We need tests really badly for this process. I would be scared to touch any of this code.
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
this.notificationsService.updateConnection(false); | ||
void this.notificationsService.updateConnection(false); |
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.
nit: I'd feel a lot better if this had some error handling and an explanation.
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.
reverted
486a4f4
Send service does not currently support specified user data manipulation, so we ensure that the notification was sent to the active user prior to processing the notification.
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.
One tiny thing.
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
33666d4
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.
Smoke tested and LGTM
* Update activity when switching users * Clear data of designated user * Do not switchMap to null, always to Promise or Observable * handle uninitialized popup services * Switch to new account immediately and log out as inactive. Split up done logging out and navigation so we can always display expire warning. * Do not navigate in account switcher, main.background takes care of it * Ignore storage updates from reseed events * Remove loading on cancelled logout * Catch missed account switch errors * Avoid usage of active user state in sync service Send service does not currently support specified user data manipulation, so we ensure that the notification was sent to the active user prior to processing the notification. * Clear sequentialize caches on account switch These caches are used to ensure that rapid calls to an async method are not repeated. However, the cached promises are valid only within a given userId context and must be cleared when that context changes. * Revert `void` promise for notification reconnect * Update libs/angular/src/services/jslib-services.module.ts Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com> * Handle switch account routing through messaging background -> app * Use account switch status to handle unlocked navigation case. * Revert "Handle switch account routing through messaging background -> app" This reverts commit 8f35078. --------- Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com> Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Create bit-cli folder with configs * Add bit-cli to workspace * Refactor CLI app structure * services are managed by the ServiceContainer * programs are registered by register(Oss|Bit)Program * the app is bootstrapped by Main * Reapply changes from #9099 * Reapply changes from #8604 * Reapply changes from #9115
Type of change
Objective
This eneded up being a bit of a hodge-podge of fixing issues around logging our and nextup user determination.
"doneLoggingOut"
remove
andsave
events that caused numerous race conditions on logout with components and services still usingfirstValueFrom
. Ignoring events that don't match the signature of our storage services -- and therefore are special cases not due to the state provider framework -- resolves all the races I was seeing around logout.Code changes
Before you submit