content: custody no longer hides a checkout, and custody visibility is enforced end to end - #242
Conversation
…bility is enforced server-side Triggered by: - Shelf-nu/shelf.nu#2830 - Shelf-nu/shelf.nu#2840 Corrects the claim that releasing custody always makes an asset available, documents the CHECKED_OUT > IN_CUSTODY > AVAILABLE precedence and the new refusal, and states that the custody-visibility toggle now governs the payload, the filter and select-all rather than only the badge.
|
Warning Review limit reached
Next review available in: 112 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Preview deployment |
Triggered by
Product change summary
#2830. Custody and bookings are independent commitments sharing one
Asset.statuscolumn, so the last writer won. Assigning custody to an asset with units out on an ongoing booking overwroteCHECKED_OUT, and Available then overstated free stock by exactly the booked quantity; releasing the last custody row advertised a physically absent asset asAVAILABLE. Every custody-driven status write now honoursCHECKED_OUT > IN_CUSTODY > AVAILABLE, and giving custody of a checked-out individual asset is refused outright. The bookings list also stopped flagging "Includes unavailable assets" merely because some units of a quantity-tracked pool sit with a custodian.#2840. The custody-visibility rule for Self-service and Base users was enforced only in the badge component, so the server still shipped custodian names in the list payload and still honoured
?teamMember=filters, including through select-all and the bulk endpoints. It is now enforced server-side in all three places.Content changes
Factual corrections
content/knowledge-base/custody-feature-for-long-term-equipment-lend-outs.mdx— "Upon release, the asset becomes fully available again" was unconditional and is now false when the asset is also checked out on a booking. Reworded, with the condition spelled out in a new section.Content enhancements
content/knowledge-base/custody-feature-for-long-term-equipment-lend-outs.mdx— new Custody and Bookings Are Separate Commitments section (the refusal on assign, the release behaviour, what a kit does with a checked-out member, the precedence rule) and a new Quantity-Tracked Pools Can Be Both at Once section covering the counting and the bookings-list flag. Two related-article links added.updatedadded.content/knowledge-base/configure-what-self-service-and-base-users-can-see.mdx— one bullet in What the Toggles Never Reach stating that with custody visibility off the name is withheld from the payload and the custodian filter is refused, including under Select all and the bulk actions and QR downloads that run on a selection. Written as how the rule works today; no unfixed exposure is described.New content
content/updates/custody-never-hides-a-checkout.mdx— changelog entry for #2830. This is a numbers-are-now-correct fix that customers can see in their own data, so it is above the changelog bar.Verified against the code, not the PR descriptions
apps/webapp/app/modules/asset/custody-status.server.tsonmain(setCustodyDrivenAssetStatus,releaseAssetsToAvailableUnlessCheckedOut), which is what every custody path now routes through.assets.$assetId.overview.assign-custody.tsxthrows a 400 naming the asset ("... is currently checked out on a booking, so it cannot be given to a custodian. Check the booking in first."), while the kit path (kits.$kitId.assets.assign-custody.tsx) filters the write instead, leaving the checked-out member onCHECKED_OUTwithout an error. The article describes the kit case as "a kit takes what it can" rather than as a refusal.list-bookings-content.tsxnow reads!availableToBook || (!isQuantityTracked(asset) && hasCustody(...)). The article and the entry only claim the quantity-tracked half changed;availableToBookstill flags both types.Deliberately not done
content/knowledge-base/quantity-tracked-assets-and-consumables.mdxwas not touched, even though a cross-link from its Quantity-aware custody section would fit. Our own PR content: Companion 1.3.0 is live — correct the mobile gap list, document what shipped #238 is open on that file and edits its frontmatterupdated:line, so a second edit is a guaranteed conflict. The substance lives in the custody article, which the QT article already links to in the other direction. Worth folding the cross-link in once content: Companion 1.3.0 is live — correct the mobile gap list, document what shipped #238 lands./updateswould mostly serve to describe what used to be possible, which is not something to publish. The rule as it works today is documented in the KB bullet instead.Review notes
custody-status.server.ts. If that ever changes, this article and the update entry both need revisiting.node scripts/check-product-claims.mjspasses (543 files, no stale claims).Impact scope
Generated by Shelf Content Intelligence — PR→Website Sync