Skip to content

test(idempotency): cover fingerprint mismatch, replay, and TTL expiry#541

Merged
mikewheeleer merged 2 commits into
Liquifact:mainfrom
uboho-prog:test/idempotency-36-mismatch-replay
Jun 29, 2026
Merged

test(idempotency): cover fingerprint mismatch, replay, and TTL expiry#541
mikewheeleer merged 2 commits into
Liquifact:mainfrom
uboho-prog:test/idempotency-36-mismatch-replay

Conversation

@uboho-prog

Copy link
Copy Markdown
Contributor

Closes #378

PR Summary

  • Add orphan in-flight protection (ORPHAN_IN_FLIGHT_TIMEOUT_MS) to prevent stuck placeholders from permanently blocking a key after a handler crash
  • Add inline TTL expiry backstop so stale un-purged rows never cause stale replays or spurious 409s
  • Add in-flight 409 (currently being processed) to prevent double-funding from concurrent requests with the same key
  • Extract buildConflict helper for RFC 7807 conflict responses
  • Use explicit ISO 8601 strings for cross-DB timestamp compatibility (SQLite vs PostgreSQL)
  • Use global db handle (not trx) for post-commit response capture
  • Add 44 integration tests against in-memory SQLite covering: header validation, first-request storage, replay, conflict 409, key isolation, TTL expiry, concurrent duplicate protection, security

- Add orphan in-flight protection (ORPHAN_IN_FLIGHT_TIMEOUT_MS) to prevent
  stuck placeholders from permanently blocking a key after a handler crash
- Add inline TTL expiry backstop so stale un-purged rows never cause stale
  replays or spurious 409s
- Add in-flight 409 (currently being processed) to prevent double-funding
  from concurrent requests with the same key
- Extract buildConflict helper for RFC 7807 conflict responses
- Use explicit ISO 8601 strings for cross-DB timestamp compatibility
  (SQLite vs PostgreSQL)
- Use global db handle (not trx) for post-commit response capture
- Add 44 integration tests against in-memory SQLite covering:
  header validation, first-request storage, replay, conflict 409,
  key isolation, TTL expiry, concurrent duplicate protection, security

Closes Liquifact#378
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@uboho-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mikewheeleer

Copy link
Copy Markdown
Contributor

solid — shipping it 🚀

@mikewheeleer mikewheeleer merged commit ad43a78 into Liquifact:main Jun 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for the idempotency middleware fingerprint mismatch and replay paths

2 participants