-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: missing ServerConfig crashes after session expired / logout [WPB-5960] #2581
fix: missing ServerConfig crashes after session expired / logout [WPB-5960] #2581
Conversation
Test Results743 tests +1 743 ✅ +1 6m 36s ⏱️ - 4m 18s Results for commit 8dc5db2. ± Comparison against base commit e5ee064. This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Build 2525 failed. |
…config-crashes-cherry-pick
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2581 +/- ##
=============================================
+ Coverage 41.24% 41.39% +0.14%
+ Complexity 1132 1129 -3
=============================================
Files 361 361
Lines 13206 13255 +49
Branches 1744 1742 -2
=============================================
+ Hits 5447 5487 +40
- Misses 7226 7236 +10
+ Partials 533 532 -1
Continue to review full report in Codecov by Sentry.
|
APKs built during tests are available here. Scroll down to Artifacts! |
Build 2536 succeeded. The build produced the following APK's: |
…config-crashes-cherry-pick
APKs built during tests are available here. Scroll down to Artifacts! |
Build 2543 succeeded. The build produced the following APK's: |
Cherry pick from the original PR:
app/src/main/kotlin/com/wire/android/GlobalObserversManager.kt
app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
app/src/main/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModel.kt
app/src/test/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModelTest.kt
kalium
PR Submission Checklist for internal contributors
The PR Title
The PR Description
What's new in this PR?
Issues
Top crashes types currently are the ones related to missing ServerConfig when making some actions.
Causes (Optional)
When session is expired (the app receives 403 when trying to refresh a token) there is an infinite loop, because the app tries to logout - deregister token which results in 401 and it triggers the auth token refresh again resulting in 403 and trying to logout again. After each iteration, CurrentSessionFlowUseCase emits the same item again, which triggers multiple actions in the whole app and creates a race condition when logging out (session should be invalid but with all the loop iterations in a fraction of a second the app can still get the previous value).
Some logout actions in Android project are not executed when account is logged out from kalium (when session expires, device is removed from another place or account deleted).
Some actions that require user session are allowed to be executed after the logout when this session is cleared and not existing anymore resulting in crashes.
Solutions
Dependencies (Optional)
Needs releases with:
Testing
Test Coverage (Optional)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References