BUGFIX: Firestore query should have orderBy to ensure correct pagination#132
Closed
canbal wants to merge 1 commit into
Closed
BUGFIX: Firestore query should have orderBy to ensure correct pagination#132canbal wants to merge 1 commit into
orderBy to ensure correct pagination#132canbal wants to merge 1 commit into
Conversation
tharropoulos
force-pushed
the
cbal/backfill_fix
branch
from
January 26, 2026 10:29
a93763e to
7748566
Compare
tharropoulos
force-pushed
the
cbal/backfill_fix
branch
from
March 18, 2026 13:58
7748566 to
00a0bb2
Compare
Collaborator
|
@canbal the tests are failing. If you bandwidth doesn't allow it I can debug myself. |
Author
|
I realized this is actually not needed. Pagination without orderBy actually
works as expected. We can close the PR.
Can
…On Wed, Mar 18, 2026 at 8:40 AM Fanis Tharropoulos ***@***.***> wrote:
*tharropoulos* left a comment (typesense/firestore-typesense-search#132)
<#132 (comment)>
@canbal <https://github.com/canbal> the tests are failing. If you
bandwidth doesn't allow it I can debug myself.
—
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTMAI26L6E7RHSDOOVGKL4RK7NXAVCNFSM6AAAAACSPAKIWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DAOBTGUZTSNZQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Collaborator
|
Thanks for the heads up! |
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
Current backfill script does not scan all documents and may miss some documents. This is not well documented by Firebase SDK documentation, but as it can be seen from all examples, an
orderByis required to ensure all documents are reliably scanned through when pagination (i.e.startAfterorstartAt) is used. Without it, the behavior is not deterministic.This PR adds a
orderBy(documentId(), "asc")to the backfill query as all collections have this native field and is not collection dependent.Test plan
I deployed the modified extension and confirmed that it's running.