Skip to content

Fix admin history pagination cursor - #1483

Open
Jiggie411 wants to merge 7 commits into
drydocs:mainfrom
Jiggie411:patch-2
Open

Jiggie411 wants to merge 7 commits into
drydocs:mainfrom
Jiggie411:patch-2

Conversation

@Jiggie411

@Jiggie411 Jiggie411 commented Nov 22, 2026 •

Copy link
Copy Markdown

Closes #1359


Summary

  • Thread the cursor query param through the admin history handler to getAdminActionHistory so pagination actually advances instead of re-fetching page 1.
  • Return page.nextCursor in the response body so the frontend can request the next page.
  • Read cursor from the query string in both the Vercel and local admin history routes.

Test plan

  • pnpm lint && pnpm typecheck && pnpm test pass locally
  • New tests cover cursor forwarding and nextCursor return

Closes

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.
@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@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 collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] Add cursor pagination to admin action history

2 participants