Bug: Order detail API returns 404 for orders placed via /api/orders #43
Labels
No labels
meeting-notes
meeting-sensitive
meeting-transcript
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/home#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When a user places an order via
POST /api/orders, the response returns anorder_idin UUID format (e.g.,069de4f1-03c0-4682-9a96-ee6e0e8f4db2). However, queryingGET /api/orders/{order_id}with that UUID returns HTTP 404.Steps to reproduce
Root cause
The
place_orderhandler generates a UUID fororder_id, but theget_order_detailshandler looks up orders via theOrderManagertrait which stores orders using OSIS SmartIDs (SIDs). The UUID returned byplace_orderdoesn't match the SID used internally byimpl_local.Expected behavior
GET /api/orders/{order_id}should return the order details when given theorder_idreturned byPOST /api/orders.Fix options
place_orderreturn the OSIS SID instead of a UUIDget_order_detailssupport both UUID and SID lookupsRepo
https://forge.ourworld.tf/mycelium_code/projectmycelium_marketplace_backend
Files:
src/axum_app/controllers/order.rs—place_order(creates UUID) andget_order_details(looks up by SID)src/services/impl_local/order_manager.rs— OSIS storage layerFound by
API integration test suite (
tests/api_integration.shin deploy repo), test: "Order detail"— mik-tf
Fixed in projectmycelium_marketplace_backend v1.4.1.
Root cause:
place_ordercontroller created a UUID and stored in an in-memoryOrderStoragesingleton, whileget_order_detailsqueried through theOrderManagertrait (OSIS). The two paths never shared data.Fix: Added
create_order_from_itemsmethod toOrderManagertrait (no session dependency).place_ordernow routes through the service layer. Order IDs are OSIS SIDs, consistent between create and read.Verified: API integration test confirms
GET /api/orders/:idreturns 200 for orders placed viaPOST /api/orders. All 120 API tests pass on dev.— mik-tf