Skip to content

[Backend] Two different withTransaction helpers exist with different retry semantics #20

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

src/db/connection.ts exports a withTransaction with transient-error retry and exponential backoff, while src/db/transaction.ts exports a separate withTransaction with no retries; importing the wrong one silently drops deadlock/serialization retry behavior on money-moving transactions.

Acceptance criteria

  • Consolidate to a single withTransaction (or clearly distinct names like withTransaction vs withTransactionNoRetry)
  • Update all imports to the canonical helper
  • Ensure money-moving paths use the retrying variant
  • Document the choice in the db module

Files to touch

  • src/db/connection.ts
  • src/db/transaction.ts

Out of scope

  • Changing isolation levels
  • Adding savepoint support

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions