Repository navigation
Harden payment settlement, retries, reporting, and demo authentication - #215
Conversation
|
Follow-up review completed after the initial blockers:
Independent review found no remaining release blockers. Added migration fixture coverage and reran the full test/build/lint/E2E gates. |
Final follow-up verificationA final review pass added a few hardening and verification details beyond the original summary:
Final verification completed:
Requesting final review from @itsbkm. |
|
I filed #214, so I read this PR properly rather than just confirming the original case. Most of it holds up under the checks I'd expect to break it — noting those first, then one edge case I think is worth a test. Verified sound (read from the diff, not run):
The edge case: I think malformed legacy In
A client resending the identical request — the exact case the Idempotency-Key path is for — gets a hard conflict instead of a no-op, and it never recovers for that bill/transaction_id pair. The comment on that catch says settlement compatibility is preserved for malformed JSON; that's true for appending a new line, but the replay path specifically loses it. The v49 backfill skips invalid JSON, so this shouldn't arrive via migration. The path I'd expect is a bill settled normally (ref row + valid JSON) whose Two directions, depending on which you consider correct: treat a ref-matched line on unparseable JSON as a replay and return current bill state, or keep the 409 but distinguish "already applied" from "conflicting reuse" so the caller can tell them apart. Caveat worth stating plainly: this is a diff read, not a reproduction — I haven't run it against your fixtures, and if Separately, and much smaller: a partially-overlapping batch (one line already applied, one new) also fails the |
|
@silasfrostx Thanks for the careful review. The malformed-JSON scenario is technically possible, but only with an already inconsistent or manually corrupted database. Normal settlement writes the transaction reference and payment details atomically, and Partial-overlap batches are intentionally rejected to preserve whole-batch idempotency. |
Summary
This PR started from Issue #214 and now provides a broader payment-integrity and recovery hardening pass:
nullamount compatibilityVerification
npm test— passednpm run build— passednpm run build:frontend— passednpm run lint— passed with existing warnings, 0 errorsgit diff --check— passedRelease notes
The updater no longer installs on app quit automatically; installation requires the explicit Restart/Install action. Migration backups are required before schema changes, and rollback should use the generated pre-migration backup rather than opening the migrated database with an older binary.
Fixes #214