Fix crash: use postValue in resetFrontDoorBridgeUrl#2908
Merged
wmathurin merged 1 commit intoMay 28, 2026
Conversation
resetFrontDoorBridgeUrl is called from onAuthFlowError which can be invoked from a background coroutine dispatcher (via doCodeExchange). LiveData.setValue throws IllegalStateException when called off the main thread. Use postValue instead.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2908 +/- ##
============================================
+ Coverage 66.41% 66.58% +0.17%
- Complexity 3099 3108 +9
============================================
Files 226 226
Lines 17774 17871 +97
Branches 2327 2339 +12
============================================
+ Hits 11804 11899 +95
+ Misses 4896 4887 -9
- Partials 1074 1085 +11
🚀 New features to boost your workflow:
|
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.
Summary
resetFrontDoorBridgeUrl()callsLiveData.setValue()but can be invoked from a background coroutine dispatcher (viaonAuthFlowError→doCodeExchangeerror path). This throwsIllegalStateException: Cannot invoke setValue on a background thread.Fix: use
postValue(null)instead ofvalue = null.Context
The bug was introduced in "Modern Login Architecture (#2653)" on 2025-01-24. It only manifests when the OAuth code exchange fails (e.g., invalid consumer key, network error during exchange) — the happy path never hits this code.
Test Plan