Skip to content

Resolve network id locally when upserting addresses - #1146

Open
Klakurka wants to merge 1 commit into
masterfrom
cursor/upsert-address-skip-network-query-22bf
Open

Klakurka wants to merge 1 commit into
masterfrom
cursor/upsert-address-skip-network-query-22bf

Conversation

@Klakurka

@Klakurka Klakurka commented Nov 7, 2026

Copy link
Copy Markdown
Member

Related to #

Description

Creating an address looked up the network with prisma.network.findUnique. That is the query named in the production pool-timeout error, and the id is already determined by the address prefix (ecash or bitcoincash).

upsertAddress now uses getNetworkIdFromSlug. An unknown prefix still returns "Invalid network slug."

Test plan

  • The address upsert unit test checks the create payload uses the address's networkId and no longer mocks network.findUnique.
  • Ran tests/unittests/addressService.test.ts (5 passed).
Open in Web Open in Cursor 

Use getNetworkIdFromSlug instead of querying Network for every upsert.
That removes a pool checkout from the cold-address path that surfaced
the production timeout on network.findUnique.

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: e9f1ecbd-f118-42d0-aa3b-cbd1b2e8e22f
Commits

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

Files selected for processing: 2

  • services/addressService.ts
  • tests/unittests/addressService.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