Repository navigation
Feature/1292 position history pagination - #1327
0darkside0rbit-star wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@0darkside0rbit-star Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
collinsezedike
left a comment
There was a problem hiding this comment.
@0darkside0rbit-star the first commit, feat(web): add local activity receipts, is the same commit as #1325, which closes #1303. This PR closes only #1292. Remove that commit so it contains only the pagination work, per the one PR per issue rule in CONTRIBUTING.md. Otherwise it conflicts with #1325, and useSignAndSubmit.ts also conflicts with #1326.
The description leaves the Summary bullet empty, the Test plan unchecked and Closes # as a placeholder, and adds a lowercase closes #1292 above them. The PR title fails PR Title; use feat(api): add position history pagination. Lint & Typecheck, Test and E2E Tests also fail.
apps/docs/architecture/api.md does not document resolution, limit or cursor.
| const DAY_MS = 24 * HOUR_MS; | ||
|
|
||
| export interface PositionHistoryBucket extends PositionSnapshot { | ||
| first: PositionSnapshot; |
There was a problem hiding this comment.
Each bucket embeds full first and last snapshots, including vaults, on top of its own vaults. That roughly triples the payload per point in a change meant to bound response size. Drop first and last, or reduce them to the totals.
| const eligible = cursorTimestamp === undefined | ||
| ? buckets | ||
| : buckets.filter((bucket) => bucket.timestamp > cursorTimestamp); | ||
| const page = eligible.slice(0, limit); |
There was a problem hiding this comment.
Without limit or cursor, this now returns the oldest 720 hourly buckets. YieldHistoryChart requests up to 90 days with neither parameter, which is about 2160 hourly buckets, so it receives the oldest 30 days and loses the newest 60. Keep the unpaginated response when none of resolution, limit or cursor is sent, or page from the newest bucket.
closes #1292
Summary
Test plan
pnpm lint && pnpm typecheck && pnpm testpass locallyCloses #