Repository navigation
fix(diagnostics): classify transport failures and describe stock refusals - #1557
Conversation
…o unreachable Share one classifier between the POS page and the payment modal. It now separates aborted requests and connection resets from true network failures, and falls back to unknown instead of unreachable. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Order-creation stock refusals now carry stock_scope (product, variant or add-on) and stock_shortfall (out of stock or partial) as diagnostic facts, returned in the response and relayed in support reports. Facts carry no item identity or quantities. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
No actionable comments were generated in the recent review. WalkthroughOrder stock-refusal responses now include bounded scope and shortfall facts. Frontend order-failure handling validates and reports those facts. POS and support code use a shared transport-failure classifier and class list. ChangesOperation failure diagnostics
Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk:
|
|
@coderabbitai review |
Action performed
|
…ostHog operation_failed Rebased onto main after FreeOpenSourcePOS#1556/FreeOpenSourcePOS#1557: adds shared ORDER_CREATE_DISPLAY_CODES, add-on capture points, PostHog operation_failed telemetry with report version/platform preservation, POS/Support Hub display_code handling, and pre-check refusal codes. Refs FreeOpenSourcePOS#1551
Related work
Issue / Discussion: #1551 (fix order items 2 and 3)
Summary
frontend/src/lib/transport-failure.ts). It addsabortedandconnection_reset, and falls back tounknowninstead ofunreachable.order.stock_insufficientnow carriesstock_scope(product, variant, add-on) andstock_shortfall(out_of_stock, partial) as facts. They are returned in the 400 response, captured to diagnostics, and relayed in the support report by the POS page. The client parser accepts only those two approved values.tests/support-ticket.test.ts(stock rejection uses the validation variant) andfrontend/e2e/diagnostics-checkout-recovery.spec.ts.Scope
Add-on pre-check refusals (
addon_item_validation) and the append route are unchanged.Verification
Commands run:
npm run lint,npm run build,npm run build:frontend,npm run i18n:check,npm run docs:check,git diff --check, and thetest:transport-failure-class(new),test:diagnostics-event,test:issue-788-order-attempt-storage,test:support-ticket,test:inventory-ledger,test:diagnostic-signature,test:diagnostics-outbox-bounds,test:diagnostic-wire-producer,test:product-variants-api,test:addon-inventory-orders,test:multi-counter-ordering,test:telemetry-leakage-prevention,test:script-coveragesuites.Results: all pass; lint shows only pre-existing warnings. Full
npm testand the e2e suite were not run.Compatibility & data safety
failure_classvalues strictly,abortedandconnection_resetmay be dropped until it is updated.Cross-cutting surfaces
factson stock refusal responses)Developer documentation
docs/reference/api.md(order failure facts)Contributor checklist
🤖 Generated with Claude Code
Summary by CodeRabbit