Repository navigation
feat: page through the complete eligible customer display queue - #1270
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 apex |
[Medium impact] The changes affect the customer-display workflow for paired devices and signed-in staff. Do not merge until both display modes can finish queues beyond 50 pages. Findings
|
|
@greptileai review this at apex |
…on and rate limiting
…and cursor index range
… preserve status index on cursor pages
fd0a30a to
a38c31a
Compare
|
@greptileai review this at apex |
Fixes #1159
Intent
Resolve FreeOpenSourcePOS/FloCafe GitHub issue #1159 (feat(customer-display): page through the complete eligible queue). Let customer displays (/customer-display) page through every eligible order, including orders older than the newest-100 feed window: add server-side cursor paging (100 per page) to GET /api/customer-display/feed while preserving paired display token authorization and the sanitized feed projection, load and merge all pages without duplicate orders in both paired display mode and signed-in staff mode, atomically update board state per poll cycle so status transitions and completed orders update cleanly without breaking the #1148 10-second TV visual page rotation, and immediately abort/clear on 401 token revocation. Verify with backend tests, Playwright E2E tests, and screenshots, run through /no-mistakes to open the PR linked to #1159 (Fixes #1159), and do not merge the PR.
What Changed
cursor,next_cursor, andhas_more) toGET /api/customer-display/feedwith 100-order page limits, base64url cursor encoding, validation returning 400 for malformed cursors, and sanitized projections./customer-displayto traverse all queue pages vianext_cursorin paired mode andbefore_idin signed-in staff mode, deduplicating orders and applying board updates atomically per poll cycle while preserving TV visual page rotations.Risk Assessment
✅ Low: The changes cleanly implement cursor-based pagination and rate-bounded polling for the customer display feed with proper status indexing, atomic state updates, and token revocation handling without regression risk.
Testing
Executed targeted backend tests, 18 Playwright customer display E2E tests, and 5 live scenarios against the running product on :3001 in Chromium at 1080p, capturing API payload JSON and 5 full-page PNG screenshots demonstrating pagination, TV rotation, atomic order status transitions, and token revocation. All checks passed.
Evidence: Scenario 1: Feed API Cursor Pagination Evidence JSON
{ "scenario": "Server-side cursor paging on GET /api/customer-display/feed", "page1": { "status": 200, "orders_count": 100, "has_more": true, "next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wMi0wMSAwMDo1MTowMCIsImlkIjo1MX0", "first_order": { "id": 51, "number": "E-051", "status": "preparing" }, "last_order": { "id": 150, "number": "E-150", "status": "ready" } }, "page2": { "status": 200, "orders_count": 50, "has_more": false, "next_cursor": null, "first_order": { "id": 1, "number": "E-001", "status": "preparing" }, "last_order": { "id": 50, "number": "E-050", "status": "preparing" } }, "total_unique_orders": 150, "sanitized_keys": [ "id", "number", "status" ], "adversarial_tests": { "malformed_cursor_status": 400, "unauthenticated_status": 401 } }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:customer-display-feednpm run test:customer-display-pairingcd frontend && npx playwright test --config=playwright.config.ts --project=chromium -g "customer display"NODE_PATH=./node_modules:./frontend/node_modules node live_verification.js (running against live Express server on :3001 with Playwright Chromium)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.