Skip to content

feat(api): Cap Threads and waiting rows in the conversation feed - #4038

Merged
BYK merged 3 commits into
mainfrom
feat/feed-thread-waiting-caps
Nov 22, 2026
Merged

BYK merged 3 commits into
mainfrom
feat/feed-thread-waiting-caps

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

GET /api/conversations had no cap on the Threads that a row nests or on the waiting rows that the first page adds from outside the page (#3809). Both caps sit well above what real feeds carry, so no row loses data today; they only bound the response.

Threads (CONVERSATION_FEED_THREAD_LIMIT = 100 per root, at any depth)

  • nestFeedThreads keeps Threads depth first in activity order, so a kept Thread always has its parent.
  • A root past the cap carries omittedThreadCount. The root's own page still lists every Thread.
  • The dashboard (sidebar and the new UI's rows) shows a muted "+N more" under the root's Threads once every loaded Thread shows.

Waiting rows (CONVERSATION_FEED_WAITING_LIMIT = 50)

  • The waiting read skips pins (they already show) and reads limit + 50 + 1 rows, so it knows whether the cap cut some without another statement.
  • The newest waiting rows join the first page. When some are cut, the feed sets waitingRowsTruncated: true. The rest come on later pages by activity like any other row, so the dashboard does not lose them.

Pins are still not paged; this leaves them as they are.

Screenshots

Mock data with omittedThreadCount: 12 on a root with two Threads.

Current dashboard sidebar:

Sidebar shows +12 more under the root's Threads

New dashboard Conversations view:

Conversation row shows +12 more under its Threads

via @BYK.

--

View Session [Sentry]

A feed row lists at most 100 Threads at any depth, kept depth first in
activity order so a kept Thread always has its parent. A root past the cap
carries `omittedThreadCount`, and the dashboard shows "+N more" under its
Threads once every loaded Thread shows.

The first page adds at most 50 waiting rows from outside the page. When it
cuts some, the feed sets `waitingRowsTruncated`; the rest come on later
pages by activity like any other row.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 22, 2026 19:36
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 22, 2026 8:15pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c1c04f. Configure here.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

471 screenshot changes — 0 changed · 471 added · 0 removed

Review screenshots in Frameshift

…ing-caps

# Conflicts:
#	packages/junior/tests/integration/api/conversations/list-budget.test.ts
@BYK
BYK enabled auto-merge (squash) November 22, 2026 20:14
@BYK
BYK merged commit c61b565 into main Nov 22, 2026
56 checks passed
@BYK
BYK deleted the feat/feed-thread-waiting-caps branch November 22, 2026 20:24

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 36f3d666 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant