feat: add cursor pagination for thread replies#6
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Owner
Author
|
Fixed the issue identified by cubic: cursor page fetch failures now throw explicit errors instead of returning an empty successful page, so auth/network failures are no longer hidden as pagination completion. Verified with targeted TypeScript check. |
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
/thread/:screen_name/:tweet_idvia?page=trueand?cursor=....?max=behavior, now using TweetDetail bottom cursors instead of DOM scrolling.Test Results
npx tsc --noEmit --target ES2022 --module ESNext --moduleResolution Bundler --esModuleInterop --skipLibCheck src/actions/common/openPage.ts src/actions/twitter/readThread.tscurl /thread/rauchg/2058245330836271263?page=true-> 200, returns replies and nextCursorcurl /thread/rauchg/2058245330836271263?cursor=<nextCursor>-> 200, returns next replies and nextCursorcurl /thread/rauchg/2058245330836271263?max=120-> 200, returns 120 repliespreknot available: noprek.tomlor.pre-commit-config.yamlfoundTest Coverage
No automated test framework covers this path. Verified against live local CDP/X session.
Review Findings
No debug logging or secrets added. Pagination token exposes only X cursor returned by upstream.
Summary by cubic
Adds cursor-based pagination to thread replies for incremental loading. Replaces DOM scrolling with TweetDetail cursor fetches using captured headers, and surfaces cursor-fetch errors clearly.
New Features
GET /thread/:screen_name/:tweet_idsupports?page=trueand?cursor=...; responses includenextCursorandhasMore.?max=still works; batches via bottom cursors until the limit.?cursor=...fetches that page directly using the TweetDetail request template.Bug Fixes
{ port }toCDP.ListandCDP.New.requestHeadersfor follow-up fetches.Written for commit 1f8db23. Summary will update on new commits. Review in cubic