ADR-00047 — Order Query and Tracking Channel Strategy for My Orders

By Engineering Team•October 11, 2026•4 min read

Status: Accepted Date: 2026-10-11 Authors: Engineering Team

Context

Once an order exists, a shopper needs three things the app didn’t previously expose: a browsable list of their own past orders, a detail view for any one of them, and a live view of an in-transit order’s shipment progress. The data needed for all three already exists server-side — order-service holds the order record itself, pii-service holds the address content, payment-service holds the payment-method catalog, and shipment-service holds the courier scan-event history — but no client-facing surface combined them.

Three concrete decisions had to be made about how the Flutter app reaches this data: which service the app talks to for order list/detail, which channel carries live shipment progress, and whether these new screens follow checkout’s cached-snapshot read pattern or always re-fetch.

Decision Drivers (FRs & NFRs)

  • SR-031 FR-01, FR-05, FR-06 — the list and detail screens must assemble several backend facts (order, address, payment method) into one response each.
  • SR-031 FR-02, NFR-01 — status shown to the shopper must reflect the order’s true current state, not a cache.
  • SR-031 FR-11, FR-12, FR-13 — Track Shipment needs a live, catch-up-capable event stream distinct from the one-shot order detail fetch.
  • SR-031 FR-09, FR-10, NFR-03 — no decision here may create a new path for one shopper to see another’s order or shipment data.

Decision 1 — Where order list/detail is served from

Option 1 — Flutter calls order-service directly over gRPC

Pros:

  • One fewer network hop between the app and the data order-service already owns.
  • No new orchestration code to write or maintain in shop-service.

Cons:

  • order-service’s gRPC surface is designed for service-to-service calls (metadata-based auth propagation, internal network only) — exposing it to a mobile client directly would mean either a second, parallel auth model just for this traffic or punching a new gRPC-to-client path through the gateway that doesn’t exist for any other mobile screen today.
  • The app would need to separately call pii-service and payment-service itself (or order-service would need to grow logic that isn’t its job) to assemble one screen’s worth of address and payment-method detail — scattering orchestration into the client instead of keeping it server-side.
  • Breaks the established pattern every other mobile screen in this app follows: the Flutter app only ever speaks GraphQL to shop-service, never gRPC directly to a backend microservice.

Option 2 — shop-service orchestrates via GraphQL, calling order-service (gRPC), pii-service (gRPC), and payment-service (gRPC) itself (CHOSEN)

Pros:

  • Consistent with how every other mobile screen already reaches backend data — the app has exactly one data-access pattern to maintain.
  • Keeps gRPC traffic internal to the service mesh, where the existing tenant/user/role metadata propagation and auth model already apply cleanly.
  • Centralizes the three-way enrichment (order + address + payment method) in one place, so the fallback behavior for a failed payment-method lookup (FR-08) is one piece of service-layer logic, not something every client has to reimplement.

Cons:

  • Adds one more hop (app → shop-service → order-service) versus calling order-service directly.
  • shop-service’s order service now depends on three downstream services instead of zero; a slowdown in any one of them (particularly payment-service’s lookup) affects order detail latency, mitigated by the graceful-fallback behavior in FR-08 rather than a stricter dependency.

Decision 2 — Which channel carries live shipment progress

Option 1 — Reuse order-service’s existing saga-progress SSE stream

Pros:

  • A live SSE stream already exists and is already wired into the checkout flow — reusing it avoids building a second stream mechanism.

Cons:

  • That stream’s purpose and lifecycle are checkout-specific: it exists to narrate the create-order saga’s own internal steps as it runs, and it is not designed to stay open or be reopened days or weeks after an order was placed, which is exactly when a shopper is most likely to check on shipment progress.
  • Shipment scan events are shipment-service’s own data, not order-service’s — routing them through order-service’s saga stream would mean order-service relaying another service’s events under a stream contract that was never designed to carry them, instead of the service that owns the data serving it directly.

Option 2 — A dedicated shipment-service SSE stream, scoped per order (CHOSEN)

Pros:

  • The service that owns the scan-event history (shipment-service) serves it directly — no relaying through a service that doesn’t own the data.
  • Can be opened independently of checkout’s lifecycle, at any point after an order ships, which is the actual shopper workflow this feature serves.
  • Already supports catch-up-then-subscribe and a tenant-scoped existence check (FR-13, FR-15) as part of its existing design, without needing to retrofit that behavior onto a stream built for a different purpose.

Cons:

  • A second SSE mechanism now exists in the system (order-service’s saga stream, and shipment-service’s tracking stream) rather than one shared implementation — accepted because the two serve genuinely different lifecycles and data owners, not because sharing wasn’t considered.
  • Inherits shipment-service’s own known limitation: the broker holding live subscriptions is in-process and single-instance, with no cross-replica replay (tracked as technical debt, not re-solved by this decision).

Decision 3 — Read-freshness strategy for these screens

Option 1 — Follow Order Confirmation’s cached-snapshot pattern

Pros:

  • Consistent with how the immediately-preceding screen in the order lifecycle (Order Confirmation, right after checkout) already reads data — a cached GraphQL response shown without a guaranteed re-fetch.
  • Fewer redundant network calls if a shopper reopens the same order repeatedly in a short window.

Cons:

  • My Orders, Order Details, and Track Shipment exist specifically so a shopper can check whether something has changed since they last looked (did it ship yet, did it arrive) — the entire value of these screens is defeated if they can silently show a stale status.
  • Order Confirmation’s cached pattern is defensible because that screen shows a snapshot of what was just submitted, which doesn’t change moment to moment the way shipment/order status does afterward.

Option 2 — Always-fresh networkOnly fetch policy on every query (CHOSEN)

Pros:

  • Directly satisfies the core purpose of these screens — the shopper always sees the order’s true current state, never a stale cached view (BR-02, NFR-01).
  • Simple, uniform rule across the list, detail, and initial tracking fetch — no per-screen cache-invalidation logic to reason about or get wrong.

Cons:

  • Strictly more network calls than a cached approach, including re-fetching unchanged data on every screen visit — accepted because order/shipment status correctness matters more here than call volume, unlike Order Confirmation’s one-time snapshot.

Final Decision

My Orders, Order Details, and Track Shipment are served entirely through shop-service’s GraphQL layer, which itself orchestrates gRPC calls to order-service, pii-service, and payment-service (Decision 1). Track Shipment’s live updates come from a dedicated, order-scoped SSE stream served directly by shipment-service, independent of order-service’s checkout-time saga stream (Decision 2). Every query across all three screens uses an always-fresh networkOnly fetch policy rather than checkout’s cached-snapshot approach (Decision 3).