Skip to content

Add AbortSignal support to openSettlement, executeSettlement, and cancelSettlementΒ #161

Description

@Jagadeeshftw

πŸ“Œ 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

  • All three settlement mutation functions accept an optional AbortSignal and forward it.
  • Existing call sites without a signal continue to work unchanged.
  • Test coverage for signal forwarding across all three functions.

πŸ”’ Security notes

No new attack surface; enables proper cancellation of in-flight mutation requests.

πŸ“‹ Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions