Skip to content

[BUG] Order Message Reliability: inconsistent tag handling causes split orders, payment misclassification, and missing shipping metadata #388

@nayan9617

Description

@nayan9617

Summary

Order rendering and lifecycle logic currently behaves inconsistently when expected tags are missing or partial. This leads to incorrect order grouping, inferred payment methods that may be wrong, and silent loss of shipping/completion metadata.

Scope of observed reliability problems

-Same logical order split into multiple rows
-If one related event has no order tag, code falls back to message id.
-Another event for the same order with order tag becomes a different key.

Result: one order appears as multiple rows/cards in Orders UI.

-Payment method misclassified from free-text content
-If payment tag is missing, payment type is inferred from message content words like “lightning” or “cashu”.

Result: UI can display a payment method that was never explicitly tagged in the event.

-Shipping/completion metadata missing silently
-Completion flow reads shipping tags from the most recent shipping-info event.
-If tracking/carrier tags are missing in that event, completion metadata is incomplete and no hard warning is shown.

Result: downstream order context is incomplete without explicit error.

Current Behavior

-Order rows can split for one logical order.
-Payment method may be incorrectly inferred.
-Completion metadata can be partial with no explicit reliability signal.

Expected Behavior

-Consolidation should use stable order identity and avoid fallback keys that fragment one order.
-Payment method should be explicit from tags or marked as unknown, not inferred from arbitrary text.
-Missing required shipping/completion fields should be validated or surfaced clearly (error/warning), not silently dropped.

Steps to Reproduce

Repro A

-Send one order-info event without order tag.
-Send another related event with order tag for the same logical order.
-Open Orders and observe duplicated/split rows.

Repro B

-Send an order-related event without payment tag.
-Include “lightning” or “cashu” in content text.
-Open Orders and observe inferred payment method in UI.

Repro C

-Send shipping-info event missing tracking or carrier.
-Mark/emit completion event for same order flow.
-Observe missing completion metadata in UI/payload.

Next.js Version

16.1.7

Operating System

macOS

Node.js Version

v24.7.0

Browser

Chrome

Screenshots

No response

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions