-
Notifications
You must be signed in to change notification settings - Fork 215
Emit source of truth errors to subscribers #177 #180
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
Conversation
|
oh wait sth is wrong i think i need to rebase w/ master |
|
oh i missed the branch name change (:fist_raised: ), rebased over main now, will push. |
14cdeb0 to
da52f4f
Compare
Codecov Report
@@ Coverage Diff @@
## main #180 +/- ##
============================================
- Coverage 86.01% 84.67% -1.34%
- Complexity 230 231 +1
============================================
Files 54 54
Lines 951 992 +41
Branches 149 164 +15
============================================
+ Hits 818 840 +22
- Misses 76 85 +9
- Partials 57 67 +10
Continue to review full report at Codecov.
|
Now source of truth can unblock reader while also letting them know that an error happened while writing. This forces readers to first dispatch the error then whatever data they have. I've also added new public WriteException/ReadException classes to SourceOfTruth so that it is easy to diagnose these problems when it hits to the developer's code
da52f4f to
08f7768
Compare
store/src/main/java/com/dropbox/android/external/store4/SourceOfTruth.kt
Outdated
Show resolved
Hide resolved
store/src/main/java/com/dropbox/android/external/store4/impl/RealStore.kt
Outdated
Show resolved
Hide resolved
* reproduce #177 and fix reader errors * dispatch write errors to receiver Now source of truth can unblock reader while also letting them know that an error happened while writing. This forces readers to first dispatch the error then whatever data they have. I've also added new public WriteException/ReadException classes to SourceOfTruth so that it is easy to diagnose these problems when it hits to the developer's code
…MobileNativeFoundation#180) * reproduce MobileNativeFoundation#177 and fix reader errors * dispatch write errors to receiver Now source of truth can unblock reader while also letting them know that an error happened while writing. This forces readers to first dispatch the error then whatever data they have. I've also added new public WriteException/ReadException classes to SourceOfTruth so that it is easy to diagnose these problems when it hits to the developer's code
This PR fixes an issue where if SourceOfTruth's read or write method fails, we would just crash.
Now SourceOfTruth has two new exception types, WriteException and ReadException where each exception is sent to downstream as a
StoreResponse.Error.Exceptionand stream is kept alive.If a write fails, reader is simply restarted (because it was previously stopped to prepare for the write).
If a read fails, reader is not restarted until another write attempt happens. This is don't to avoid creating an infinite loop of trying to read from disk.