Skip to content

BazaRb#fee has no idempotency badge, so a retried 5xx charges the user twice #488

Description

@morphqdd

fee posts to /account/fee through post (lib/baza-rb.rb:492), and post runs inside retry_on, which repeats the request on any 429 and any code above 499. A fee is money leaving the account, and nothing in the request lets the server recognise a repeat.

What happens: when a proxy answers 503 after the server has already booked the fee, the client books it again.

fee returned: 7
POSTs to /account/fee: 2
  #0: _csrf=tok&amount=1.500000&job=42&summary=coffee&tab=unknown
  #1: _csrf=tok&amount=1.500000&job=42&summary=coffee&tab=unknown
fee params:      [[:req, :tab], [:req, :amount], [:req, :summary], [:req, :job]]
transfer params: [[:req, :recipient], [:req, :amount], [:req, :summary], [:key, :job], [:key, :badge]]

transfer was given a badge: for exactly this in #423; fee never got one.

What should happen: fee should accept a badge: idempotency key the way transfer does and send it in the body, so the server can collapse a repeated charge.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions