π Description
Similarly to anchorsApi.ts's read functions, fetchSettlements/fetchSettlement (src/lib/settlementsApi.ts) accept an optional signal, but openSettlement, executeSettlement, and cancelSettlement do not. SettlementsPanel/SettlementDetail currently have no way to cancel an in-flight mutation if the component unmounts or the user triggers another action before the first settles.
π§© Requirements and context
- Add an optional
signal?: AbortSignal parameter to openSettlement, executeSettlement, and cancelSettlement in src/lib/settlementsApi.ts, forwarded to the underlying apiRequest call.
- No change to the functions' existing required parameters or return types.
- Wiring consuming components to pass a signal is out of scope for this issue; it's about the API layer's capability.
π οΈ Suggested execution
- Update
openSettlement/executeSettlement/cancelSettlement in src/lib/settlementsApi.ts to accept and forward an optional signal.
- Extend
src/lib/settlementsApi.test.ts to assert the signal is forwarded to the underlying request for each function.
β
Acceptance criteria
π Security notes
No new attack surface; enables proper cancellation of in-flight mutation requests.
π Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
π Description
Similarly to
anchorsApi.ts's read functions,fetchSettlements/fetchSettlement(src/lib/settlementsApi.ts) accept an optionalsignal, butopenSettlement,executeSettlement, andcancelSettlementdo not.SettlementsPanel/SettlementDetailcurrently have no way to cancel an in-flight mutation if the component unmounts or the user triggers another action before the first settles.π§© Requirements and context
signal?: AbortSignalparameter toopenSettlement,executeSettlement, andcancelSettlementinsrc/lib/settlementsApi.ts, forwarded to the underlyingapiRequestcall.π οΈ Suggested execution
openSettlement/executeSettlement/cancelSettlementinsrc/lib/settlementsApi.tsto accept and forward an optionalsignal.src/lib/settlementsApi.test.tsto assert the signal is forwarded to the underlying request for each function.β Acceptance criteria
π Security notes
No new attack surface; enables proper cancellation of in-flight mutation requests.
π Guidelines