Repository navigation
fix(server-app): preserve drafts during send - #1151
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@greptile review |
[Medium impact] Adds draft preservation logic during order send. The PR needs a retry fix before merging because saving an unchanged edit can duplicate an order. Findings
|
|
@greptileai review |
bf0f5e9 to
dc3c78a
Compare
|
@greptileai review |
1 similar comment
|
@greptileai review |
dc3c78a to
7a2a2e2
Compare
|
@greptileai review |
Co-Authored-By: Claude Code <[email protected]>
|
Greptile P1 addressed in ac92516: removed the eager |
Intent
PR 4 - Prevent Server App draft loss during send (Fixes #1140)
Branch:
codex/server-app-send-raceTitle:
fix(server-app): preserve drafts during sendChoose the minimal freeze-during-send approach:
Acceptance: a delayed send cannot silently lose a second item; double Send creates one mutation; failed sends retain their draft; table changes cannot display a response against the wrong table.
What Changed
SendSnapshotinfrontend/src/app/server-standalone/page.tsxpaired with the idempotency nonce, gatesendDraftuntil the active table's order lookup finishes, and subtract only acknowledged line quantities and matching notes on success while preserving the snapshot and retry key across failed sends.ProductGridinteractions, pre-send addon/edit customizer callbacks, customer and order-note inputs, table switching, and refresh handlers viasendInFlightRefand send sequence tracking while a submission is in flight, while running post-send KOT printing and background refresh from the snapshot without blocking completion.frontend/e2e/server-app-ordering.spec.tsverifying draft freeze during delayed sends, rejection of stale customizer modal submissions, draft and idempotency-key retention after failed sends and table switches, and non-blocking KOT printing.Risk Assessment
✅ Low: The change cleanly freezes Server App draft and table controls during an in-flight send using an immutable submission snapshot, synchronous ref guards, sequence-guarded customizer callbacks, and table-lookup gating, with comprehensive E2E test coverage.
Testing
Built the backend and static frontend, ran the full 6-test Playwright E2E suite in
frontend/e2e/server-app-ordering.spec.tsandnpm run test:server-app-server-roleagainst isolated disposable server instances, and captured three live browser screenshots in the evidence directory verifying the frozen in-flight controls, post-send append behavior, and retained draft state after a failed send.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm run build && npm run build:frontendE2E_BASE_URL=http://127.0.0.1:43001 E2E_KDS_BASE_URL=http://127.0.0.1:43002 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43003 npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium frontend/e2e/server-app-ordering.spec.tsnpm run test:server-app-server-roleLive Playwright browser capture againsttests/e2e-server.cjsproducingserver-app-sending-frozen.png,server-app-order-sent-append.png, andserver-app-failed-send-retained-draft.png✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.