-
Notifications
You must be signed in to change notification settings - Fork 214
Propagate converter exceptions instead of hanging indefinitely #728
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
Merged
+290
−19
Conversation
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
Signed-off-by: Matt Ramotar <matt.ramotar@uber.com>
store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/FetcherController.kt
Show resolved
Hide resolved
store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/FetcherController.kt
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #728 +/- ##
==========================================
+ Coverage 79.17% 79.76% +0.58%
==========================================
Files 42 42
Lines 941 919 -22
Branches 169 172 +3
==========================================
- Hits 745 733 -12
+ Misses 120 111 -9
+ Partials 76 75 -1
🚀 New features to boost your workflow:
|
Signed-off-by: Matt Ramotar <matt.ramotar@uber.com>
store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/RealStore.kt
Show resolved
Hide resolved
store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/FetcherController.kt
Show resolved
Hide resolved
Signed-off-by: Matt Ramotar <matt.ramotar@uber.com>
store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/impl/RealStore.kt
Show resolved
Hide resolved
Signed-off-by: Matt Ramotar <matt.ramotar@uber.com>
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.
Closes #660
Problem
When
Converter.fromNetworkToLocal()throws an exception,store.stream()andstore.get()hang indefinitely instead of emitting an error.Root Cause
Conversion happens inside the Multicaster's
onEachcallback. Exceptions there propagate to the internal actor, which terminates and closes downstream channels silently. This means no error signal reaches collectors.Solution
Move conversion and SourceOfTruth writes from
onEachinto the source flow'smapoperator. Exceptions are now caught and emitted asStoreReadResponse.Error.Exception, allowing callers to handle them appropriately.Note
Addresses hanging when
Converter.fromNetworkToLocal()throws by handling conversion inside the fetcher source and emitting errors.FetcherController, move conversion and SOT writes fromonEachto the sourcemapwith try/catch; rethrowCancellationException, emitStoreReadResponse.Error.Exceptionon failure; no-oponEachto avoid actor shutdownsRealStore, adjust disk/network merge: unlock disk on networkData/NoNewData/Error; tracknetworkErrorWithNoFallbackto suppress SOT emissions for fresh requests when fallback is disabled; preserve fetcher name in originsWritten by Cursor Bugbot for commit 50dc877. This will update automatically on new commits. Configure here.