fix: Paginate conversation fetches to exhaustion#43
Merged
Conversation
conversation list/with fetched a single unpaginated page, so the server's default limit of 20 silently truncated results and quiet conversations looked deleted. Fetch now pages by the strict compound (lastActive, id) cursor (limit 500) until a short page, deduping boundary repeats from legacy inclusive servers, and fails loudly with PAGINATION_STALLED instead of truncating when the cursor stops advancing. The active state now requests archived: false explicitly - omitting the flag returns the server's unfiltered stream, which 'all' now uses in a single pass. findDirectConversation walks the same paginated stream with an early return on match. Needs @doist/comms-sdk with pagination args (comms-sdk-typescript#49). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
doistbot
reviewed
Jul 10, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR fixes the "disappearing group DMs" bug by paginating conversation fetches to exhaustion using a compound (lastActive, id) cursor, with early-return for direct lookups and proper dedup/stall detection.
Few things worth tightening:
- The new pagination request fields (
limit,olderThan,beforeId) don't exist in the currently locked@doist/comms-sdk0.7.1 — the SDK bump and lockfile update need to be included for the build to pass. - Boundary-row dedup is handled in
fetchAllConversationsbut not in thefindDirectConversationgroup-count scan, which can double-count a conversation that appears at a page boundary on legacy inclusive servers — the iterator should yield only unseen rows, or callers should track seen IDs consistently.
Brings the getConversations pagination args (comms-sdk-typescript#49) that the exhaustive conversation fetch relies on. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A legacy inclusive server repeats the page boundary row; the direct- conversation scan counted that group twice in its suggestion. Dedupe now happens in the iterator, so every consumer sees each row once, and the redundant Map in fetchAllConversations is gone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
scottlovegrove
approved these changes
Jul 10, 2026
doist-release-bot Bot
added a commit
that referenced
this pull request
Jul 10, 2026
## [1.9.2](v1.9.1...v1.9.2) (2026-07-10) ### Bug Fixes * Paginate conversation fetches to exhaustion ([#43](#43)) ([0e1ee31](0e1ee31))
Contributor
|
🎉 This PR is included in version 1.9.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Context
"Disappearing group DMs":
tdc conversation list/withfetched one unpaginated page, so the server default limit of 20 silently truncated results — quiet conversations looked deleted (--limitis documented as "default: all").What was changed
getConversationsByState/findDirectConversationpage throughconversations/getwithlimit: 500and the strict compound(lastActive, id)cursor until a short page;findDirectConversationearly-returns on match.PAGINATION_STALLEDinstead of silently truncating.activenow sendsarchived: falseexplicitly (omitting it returns the server's unfiltered stream — whichallnow uses in a single pass instead of two calls).--limitstays an output cap applied after local filters.Refs
@doist/comms-sdkhere once it releases; typecheck fails against 0.10.0 until then.🤖 Generated with Claude Code