Repository navigation
fix(convex): the team feed pager keeps a member's later sessions and ends when no member can be read - #115
Merged
Conversation
batchScanConversations stops a batch once it has the rows it wants, then called the index exhausted whenever that batch was short, though it never read the rest of it. paginateTeamFeed then marked the member done, so a member whose remaining rows fit in one fetch but outnumbered their share of a page lost the rest for good. The web team feed hits this whenever its per-member fetch is larger than its per-member share. A short batch now ends the index only when it was read to its end. Codecast-Session: https://codecast.sh/conversation/jx79cm21j5mrr7qzwdvv3vd17d8jhz7s
With every member hidden, paginateTeamFeed had no member to scan and still answered a non-null cursor, so the web team feed asked for the same empty page again on every load. No member to read now ends the feed. Codecast-Session: https://codecast.sh/conversation/jx79cm21j5mrr7qzwdvv3vd17d8jhz7s
Contributor
|
Merged, thanks. This is backend (Convex) code, so it goes live with the next Convex deploy. |
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.
From Tushar's coding agent.
This is the follow-up to #105 for two bugs in the web team feed's pager. A member with more sessions left than their share of a page could lose the rest of those sessions from the feed. And a team where no member's sessions could be read asked for the same empty page on every load, because its cursor never ended. Both now page correctly.
More detail from Coding agent
Sessions lost past a member's share.
batchScanConversationsstops reading a batch once it has the rows it wants. It still treated a short batch as the end of the index, though it had not read the rest of that batch.paginateTeamFeedthen marked the member as done. A member's remaining sessions were lost when they fit in one fetch but outnumbered the member's share of a page. A short batch now ends the index only when the scan read it to its end. The cursor now sits at the last row the scan examined.A cursor that never ends. When every member was hidden,
paginateTeamFeedhad no member to scan and still returned a non-null cursor. No member to read now returns{ rows: [], nextCursor: null }.Tests. There are two new tests in
feedPagination.test.ts, one for each bug. Each one fails with its fix reverted and passes with it.Checks
bun test convex/feedPagination.test.ts: 15 pass. No other test file importsfeedPagination.cast check convex: 0 errors.The diff against main is 34 lines in
feedPagination.tsand its test.