Repository navigation
fix(orders): scope pending-edit notices and async handlers to active order - #1260
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 |
|
@greptileai review this at plus |
[Medium impact] The follow-up changes appear safe to merge, with all three previous findings addressed.
|
…I checks: 1. **`Lint & Build Validation (Linux)` failure:** - **Root cause:** `frontend/e2e/issue-1257-pending-edit-scope.spec.ts` had unformatted imports/code causing `oxfmt --check` to fail during `scripts/ci/check-changed-format.cjs`. - **Fix:** Formatted the file using `npx oxfmt --write` according to repository formatting standards. 2. **`Playwright E2E (Shard 2/4)` and `End-to-End Playwright Tests` failures:** - **Root cause:** In `frontend/e2e/issue-1257-pending-edit-scope.spec.ts`, `EVIDENCE_DIR` was hardcoded to a local user path (`/Users/gurkiratkhaira/.no-mistakes/evidence/...`) and unconditionally invoked `page.screenshot()`. On CI Ubuntu runners where this directory did not exist, `page.screenshot()` failed with `ENOENT: no such file or directory` across all 3 scenarios. - **Fix:** Made screenshot capture conditional on `process.env.EVIDENCE_DIR` via a helper `captureScreenshot()` that verifies directory existence with `fs.mkdirSync(EVIDENCE_DIR, { recursive: true })` and safely ignores captures in CI runs where `EVIDENCE_DIR` is unset. 3. **`Required Checks Gate`:** - Satisfied as the underlying check dependencies (`Lint & Build Validation` and `Playwright E2E`) are resolved. Local verification executed: - `npm run format:check:changed -- --base 0818717` (Passed) - `npm run lint` & `npm run lint:budget` (Passed, 0 warnings/errors in frontend) - `npx playwright test e2e/issue-1257-pending-edit-scope.spec.ts` (All 3 scenarios passed both with and without `EVIDENCE_DIR`) - `npm run test:order-item-edit` (177/177 unit tests passed) - `npm run docs:check` (Passed) - `npm run i18n:check` (Passed) - `git diff --check` (Clean)
|
@greptileai review this at plus |
Fixes #1257
Intent
Fix finding N5 (GitHub issue #1257) in FreeOpenSourcePOS/FloCafe: scope pending-edit recovery notices, refresh errors, storage warnings, inline issues, and in-flight async handlers in
frontend/src/components/orders/PendingOrderItemEdits.tsxandfrontend/src/components/orders/OrderDetailPanel.tsxto the selected(tenantId, actorId, orderId)so switching orders never displays or triggers recovery warnings/refreshes from a previously selected order or a late-settling async request from another order.What Changed
(tenantId, actorId, orderId)and keyed order components by order ID inOrderDetailPanel.Risk Assessment
✅ Low: The changes cleanly scope pending-edit state and in-flight resolution handlers to the active (tenantId, actorId, orderId) tuple with component keying and versioned cancellation, backed by comprehensive unit and E2E coverage.
Testing
Exercised the live product end-to-end in Chromium against the running FloCafe Express API server and static Next.js frontend across 3 live scenarios (order switching with notices, adversarial late-settling async 409 resolution, and storage recovery scoping) alongside 177 unit and component harness tests in test:order-item-edit, all passing with 5 visual screenshot artifacts captured.
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 test:order-item-editcd frontend && EVIDENCE_DIR=~/.no-mistakes/evidence/01M5EJCT0WY8Q1F5Z5JPGVATRD npx playwright test --config=playwright.config.ts e2e/issue-1257-pending-edit-scope.spec.ts --project=chromium✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.