Skip to content

Page address transactions by addressId - #1144

Open
Klakurka wants to merge 1 commit into
masterfrom
cursor/address-tx-query-by-addressid-22bf
Open

Klakurka wants to merge 1 commit into
masterfrom
cursor/address-tx-query-by-addressid-22bf

Conversation

@Klakurka

@Klakurka Klakurka commented Nov 7, 2026

Copy link
Copy Markdown
Member

Related to #

Description

The address transactions query filtered through the address relation and allowed pages of up to 2000 rows. That missed Transaction_addressId_timestamp_idx and held pool connections on large offset scans.

The handler resolves the address once, queries Transaction by addressId, and caps this endpoint at 500 rows. Other endpoints still use the 2000 limit.

Test plan

  • Unit tests assert the transaction query filters on addressId.
  • Ran the address orderBy cases in tests/unittests/transactionService.test.ts (3 passed).
  • A pageSize above 500 on this route returns ADDRESS_PAGE_SIZE_LIMIT_EXCEEDED_400.
Open in Web Open in Cursor 

Resolve the address once and filter Transaction by addressId so MySQL
can use Transaction_addressId_timestamp_idx. Cap this endpoint at 500
rows per page to avoid large offset scans.

Co-authored-by: David <Klakurka@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6380ff61-dd13-44a8-b2ff-77b78db500d9
Commits

Reviewing files that changed from the base of the PR and between cac26a3 and 1dc9af4.

Files selected for processing: 4

  • constants/index.ts
  • pages/api/address/transactions/[address].ts
  • services/transactionService.ts
  • tests/unittests/transactionService.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

2 participants