fix(firestore): catch InterruptedException in FirestorePagingSource#2404
Open
demolaf wants to merge 5 commits into
Open
fix(firestore): catch InterruptedException in FirestorePagingSource#2404demolaf wants to merge 5 commits into
demolaf wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds handling for InterruptedException in FirestorePagingSource.loadSingle to prevent undeliverable RxJava exceptions when interrupted while disposed, and includes a corresponding integration test. The review feedback suggests avoiding logging expected errors at the ERROR level in the library to prevent cluttering Logcat, and recommends saving and restoring the original RxJavaPlugins error handler in the test to avoid side effects on other tests.
…lace sleeps with latches
demolaf
marked this pull request as ready for review
July 21, 2026 12:34
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.
Fixes #2008.
FirestorePagingSource.loadSingle()blocks onTasks.await(task)inside aSingle.fromCallable. When Paging cancels an in-flight load, RxJava disposes the subscription, which interrupts the IO-scheduler thread mid-await, throwingInterruptedException. The source only caughtExecutionException, so theInterruptedExceptionescaped the callable after the subscription was already disposed — RxJava couldn't deliver it downstream, so it surfaced as anUndeliverableExceptionon the global handler and crashed the app.DatabasePagingSource(RTDB paging) already catchesInterruptedExceptionand returns aLoadResult.Errorinstead of throwing; this applies the same fix toFirestorePagingSource.Preview
untitled.webm