Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 19, 2025

Changelist

Fix /v4/pnl/parentSubaccountNumber endpoint to return empty array instead of error when no PNL data matches filters

  • Removed the NotFoundError check when pnlData.results.length === 0 - now returns {"pnl":[]} instead of an error
  • Added subaccount existence check at the start of the endpoint - returns 404 only if the parent subaccount doesn't exist at all
  • This fixes the issue where queries with createdBeforeOrAt filter that excluded all data would return an error instead of an empty array

Test Plan

Added controller tests:

  • Get /pnl/parentSubaccountNumber returns empty array when date filter excludes all data - verifies both daily and hourly endpoints return 200 with empty array when createdBeforeOrAt excludes all records
  • Get /pnl/parentSubaccountNumber returns empty array when no PNL records exist - verifies empty array is returned when subaccount exists but has no PNL data
  • Updated Get /pnl/parentSubaccountNumber with non-existent address returns 404 - verifies 404 is still returned for non-existent addresses

Tested in staging,
before:
Screenshot 2025-12-19 at 12 53 14 PM
after:
Screenshot 2025-12-19 at 1 03 01 PM

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

This is an automatic backport of pull request #3291 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner December 19, 2025 19:05
@linear
Copy link

linear bot commented Dec 19, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@davidli1997 davidli1997 merged commit 5884394 into release/indexer/v9.x Dec 19, 2025
31 of 32 checks passed
@davidli1997 davidli1997 deleted the mergify/bp/release/indexer/v9.x/pr-3291 branch December 19, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants