Skip to content

fix: Paginate conversation fetches to exhaustion#43

Merged
amix merged 4 commits into
mainfrom
amix/paginate-conversation-list
Jul 10, 2026
Merged

fix: Paginate conversation fetches to exhaustion#43
amix merged 4 commits into
mainfrom
amix/paginate-conversation-list

Conversation

@amix

@amix amix commented Jul 10, 2026

Copy link
Copy Markdown
Member

Context

"Disappearing group DMs": tdc conversation list / with fetched one unpaginated page, so the server default limit of 20 silently truncated results — quiet conversations looked deleted (--limit is documented as "default: all").

What was changed

  • getConversationsByState / findDirectConversation page through conversations/get with limit: 500 and the strict compound (lastActive, id) cursor until a short page; findDirectConversation early-returns on match.
  • Boundary rows repeated by legacy inclusive servers dedupe by id; a full page with no new rows raises PAGINATION_STALLED instead of silently truncating.
  • active now sends archived: false explicitly (omitting it returns the server's unfiltered stream — which all now uses in a single pass instead of two calls).
  • --limit stays an output cap applied after local filters.

Refs

🤖 Generated with Claude Code

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>
@amix amix added the 👀 Show PR PR must be reviewed before or after merging label Jul 10, 2026
@amix amix marked this pull request as ready for review July 10, 2026 16:03

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sdk 0.7.1 — the SDK bump and lockfile update need to be included for the build to pass.
  • Boundary-row dedup is handled in fetchAllConversations but not in the findDirectConversation group-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.

Share FeedbackReview Logs

Comment thread src/commands/conversation/helpers.ts
Comment thread src/commands/conversation/helpers.ts
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>
Comment thread src/commands/conversation/helpers.ts Outdated
amix and others added 2 commits July 10, 2026 18:47
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>
@amix amix merged commit 0e1ee31 into main Jul 10, 2026
5 checks passed
@amix amix deleted the amix/paginate-conversation-list branch July 10, 2026 17:27
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))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.9.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants