fix(firestore): catch InterruptedException in FirestorePagingSource - #2404
Merged
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.
demolaf
marked this pull request as ready for review
July 21, 2026 12:34
…2383) * fix(auth): validate display name only when required in sign-up form * fix(auth): use locale-safe matcher for sign-up button in test
russellwheatley
requested changes
Jul 24, 2026
russellwheatley
left a comment
Member
There was a problem hiding this comment.
One suggestion on error visibility, otherwise this looks solid. Ran the paging test locally and confirmed the fix works, including the new disposal-interrupt regression test.
russellwheatley
approved these changes
Jul 29, 2026
…lace sleeps with latches
demolaf
force-pushed
the
fix/firestore-paging-interrupt
branch
from
July 29, 2026 11:24
a43c700 to
6da622d
Compare
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