Bug: Slice rental manage/cancel returns 404 — UUID vs OSIS SID mismatch #44
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#44
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 rents a product via
POST /api/products/:id/rent, the response returns arental_idin UUID format. However, the dashboard endpoints for managing and canceling slice rentals (POST /api/dashboard/slice-rentals/:id/manageandDELETE /api/dashboard/slice-rentals/:id) return HTTP 404 when called with that UUID.Steps to reproduce
Root cause
Same pattern as the order detail bug: the
rent_producthandler inrental.rsgenerates a UUID for the rental, but the dashboard slice rental endpoints indashboard/user.rslook up rentals using OSIS SmartIDs (SIDs). The UUID doesn't match the SID.Expected behavior
The
rental_idreturned by the rent endpoint should be usable with the manage and cancel endpoints.Fix options
rent_productreturn the OSIS SID instead of a UUIDRepo
https://forge.ourworld.tf/mycelium_code/projectmycelium_marketplace_backend
Files:
src/axum_app/controllers/rental.rs—rent_product,rent_node_product(create UUID)src/axum_app/controllers/dashboard/user.rs—manage_slice_rental_deployment,cancel_slice_rental(look up by SID)src/services/impl_local/slice_rental_manager.rs— OSIS storage layerFound by
Rental integration test suite (
tests/rental_integration.shin deploy repo)Related
Same root cause as the order detail 404 bug (UUID/SID mismatch pattern).
— mik-tf
Fixed in projectmycelium_marketplace_backend v1.4.1.
Root cause (3 parts):
rent_productgenerated a throwaway UUID without creating any OSIS record.cancel_rentalthen tried to find it in OSIS — nothing there.cancel_slice_rentalfound the rental but only logged an activity — never updated OSIS status to Cancelled.manage_slice_rentalwas a stub that responded success without looking up the rental.Fix:
rent_productnow creates a realSliceRentalviaSliceRentalManager.rent_slice_combination(). Returns the OSIS SID.cancel_slice_rentalmethod toSliceRentalManagertrait — updates OSIS status to Cancelled.manage_slice_rentalnow verifies the rental exists and the terminate action actually cancels via the service layer.Verified: All 120 API tests pass on dev. Rental integration: 12/12.
— mik-tf