Open
Description
See detailed discussion in #1406
Suggested work
- Combine
txHelper
utility intooperations
manager- Transactions are really grouping constructs of operations, and tracking the events for async completion
- There is weirdness that the
operations
helpers do not have direct access to theidempotencyKey
- There is a lot of boilerplate in other packages, joining together
txHandler
andoperations
functions
- Merge the
SubmitNewTransaction
andResubmitOperations
functions. Return options are:- There is no idempotency key, here's a shiny new TX
- We've never stored a TX for this idempotency key, here's a shiny new TX
- TX already existed for idempotency key all done now - please return without error to the user
- TX was stored, but no operations were stored - here's the existing transaction ID
- All operations in the TX already reached
Pending
(or later), 409 to your user - Something else went wrong
- (Separable) Update idempotency input handling to reject re-submit with different inputs
- Scenario:
- Submit with
input1
andidem1
, and get to a point ofInitialized
operations - Encounter failure that is not handled via internal retry and returns an error to you
- Re-submit the API call, but this time with
input2
andidem1
- Internally FF Core already stored the operations, so re-submits them with
input1
(notinput2
) - Transaction completes with
input1
- we ignored theinput2
you provided
- Submit with
- Improved behavior:
- Return an error stating that
input2
is not the same asinput1
- Requires per-input handling to detect the operation inputs are the same or not
- Return an error stating that
- Scenario: