Skip to content

Add idempotency-key support to the audit write endpoints #501

Description

@mikewheeleer

Idempotent audit

Description

Retried audit writes can double-apply. This issue adds idempotency-key support.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-backend only.
  • Accept an Idempotency-Key on audit writes and return the stored result on replay within a TTL.
  • Reject a reused key with a different body (409).
  • Cover first-write, replay, and conflict in tests.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/audit-91-idem
  • Implement changes
    • Write code in: the relevant module.
    • Write comprehensive tests in: cover the new behaviour and edge cases.
  • Test and commit

Test and commit

  • Run npm run lint, npm test, and npm run build.
  • Cover edge cases: first write, replay same, replay different body 409.
  • Include the full test output in the PR description.

Example commit message

feat(audit): add idempotency keys

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord: https://discord.gg/eXvRKkgcv
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions