Skip to content

Fix order status never updating past placed - #11

Merged
devinder-dev merged 1 commit into
mainfrom
fix-order-status-sync
Jun 22, 2026
Merged

devinder-dev merged 1 commit into
mainfrom
fix-order-status-sync

Conversation

@devinder-dev

Copy link
Copy Markdown
Owner

Summary

  • The order service never consumed order.accepted/order.ready, so GET /orders/:id always returned "placed" even after the kitchen finished cooking — kitchen only ever updated its own database, never order's.
  • Added a consumer (order-events.ts) that updates order's own row on both events, with its own Redis idempotency namespace, wired into both index.ts and the e2e test.
  • Strengthened the e2e test to assert the real public /orders/:id endpoint reaches "ready", which is what should have caught this originally (the old assertion only checked kitchen's internal database).

Test plan

  • bun run typecheck clean
  • bun run test green across all packages
  • Verified manually against the real Docker stack: placed -> accepted -> ready via curl http://localhost/api/orders/:id
  • Snyk: 0 issues

The order service never consumed order.accepted/order.ready, so its own
row (the one GET /orders/:id actually reads) stayed "placed" forever even
after the kitchen had accepted and readied the order. Kitchen only ever
updated its own database, never order's. Added a consumer
(order-events.ts, same extraction pattern as the outbox poller) that
updates order's row on both events, with its own Redis idempotency
namespace.

Also strengthened the e2e test to assert the real public /orders/:id
endpoint reaches "ready", not just kitchen's internal database — that's
what should have caught this originally.
@devinder-dev
devinder-dev merged commit f209933 into main Jun 22, 2026
1 check passed
@devinder-dev
devinder-dev deleted the fix-order-status-sync branch June 22, 2026 16:01
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.

1 participant