[Bug]: Admin "Create Fulfillment" ignores reservation location — defaults to the shipping option's location and counts availability across locations, enabling silent inventory corruption#16338
Versions: @medusajs/medusa 2.15.3, @medusajs/dashboard 2.15.3 (behavior verified byte-identical in dashboard 2.18.0, latest at time of writing). Node 24, Postgres 16.
Summary
The Create Fulfillment modal makes two related mistakes with multi-location setups, and the backend workflow it drives has no guard for the resulting mistake — the combination silently corrupts inventory at both locations.
(1) The Location dropdown defaults to the shipping option's fulfillment-set location, never the reservation's. In order-create-fulfillment the default is set by a useEffect:
const locationId = shippingOption.service_zone.fulfillment_set.location.id;
form.setValue("location_id", locationId);
The ironic part: the modal already fetches the order's reservations (it uses them in the availability computation below) — the correct location is sitting in component state and is never used for the default.
(2) The item "available" count adds reserved quantity without filtering reservations by the selected location:
const reservation = reservations?.find((r) => r.line_item_id === item.id);
// ...
availableQuantity: Math.floor(maxAvailableQuantity + reservedQuantityForItem)