Repository navigation
Conversation
Allow handleGetAdminHistory to accept an optional cursor, forward it to getAdminActionHistory, and return page.nextCursor so callers can paginate.
Parse ?cursor= from the request and forward it to handleGetAdminHistory so paginated history works on Vercel.
Parse ?cursor= from the Fastify query and forward it to handleGetAdminHistory so local pagination matches Vercel.
Cover forwarding cursor to getAdminActionHistory and returning page.nextCursor in the response body.
|
@Jiggie411 is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
collinsezedike
left a comment
There was a problem hiding this comment.
@Jiggie411 this duplicates #1474, which is still open for #1359. Close one of them and keep a single PR.
The build fails with packages/api-core/src/admin-history.ts(40,11): error TS2353: 'cursor' does not exist in type 'GetAdminActionHistoryOptions'. The PR does not touch packages/stellar-sdk-helpers/src/admin-history.ts, where getAdminActionHistory takes no cursor and returns AdminAction[]. nextCursor: (actions as any)?.nextCursor ?? null is therefore always null, so pagination never advances. #1359 needs the helper to encode and accept the cursor (last ledger and operation position), and tests for the first page, a continuation and a malformed cursor.
The PR raises ADMIN_HISTORY_TIMEOUT_MS from 8,000 to 45,000 and rewrites the comment above it. api/v1/admin/[resource].ts has maxDuration: 10 in vercel.json, so a 45 second budget would be killed by the platform. Revert both changes.
The title and every commit header have no type, which fails PR Title and Commit Messages. Use feat(api): add cursor pagination to admin history. Remove the Merge branch 'main' into patch-2 commit. The description has Closes #1359 above a --- and a stray empty ## Closes # section, and the Test plan is unchecked. Use ## Summary, ## Test plan and one Closes #1359.
…dmin-history to use object form + return nextCursor
Closes #1359
Summary
cursorquery param through the admin history handler togetAdminActionHistoryso pagination actually advances instead of re-fetching page 1.page.nextCursorin the response body so the frontend can request the next page.cursorfrom the query string in both the Vercel and local admin history routes.Test plan
pnpm lint && pnpm typecheck && pnpm testpass locallynextCursorreturnCloses