From da932fb309cd85acd3127566e92a1644cf038bdb Mon Sep 17 00:00:00 2001 From: James Maes Date: Wed, 14 Oct 2026 09:55:21 -0500 Subject: [PATCH] feat(attachments): honor the bucket upload cap via object storage's api (qbit-object-storage 0.1.0-RC.4) AttachmentStorage.maxBytes now reads StorageBucket.maxUploadBytes() from the api package (null = no bucket limit); uploads stop at the smaller of the bucket cap and the per-table cap. Co-Authored-By: Claude Opus 5.5 --- pom.xml | 2 +- .../collaboration/attachments/AttachmentStorage.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 5b2cdb2..80ef42e 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ com.kingsrook.qbits qbit-object-storage - 0.1.0-RC.2 + 0.1.0-RC.4 com.kingsrook.qqq diff --git a/src/main/java/com/kingsrook/qbits/collaboration/attachments/AttachmentStorage.java b/src/main/java/com/kingsrook/qbits/collaboration/attachments/AttachmentStorage.java index 724933d..73e7f50 100644 --- a/src/main/java/com/kingsrook/qbits/collaboration/attachments/AttachmentStorage.java +++ b/src/main/java/com/kingsrook/qbits/collaboration/attachments/AttachmentStorage.java @@ -45,14 +45,13 @@ public class AttachmentStorage } /******************************************************************************* - ** The bucket's own upload cap, when object storage exposes it through its api - ** package. It does not yet (requested from qbit-object-storage), so this - ** returns Long.MAX_VALUE: collaboration enforces its configured per-table cap, - ** and object storage still enforces the bucket's cap when the object is put. + ** The bucket's own upload cap, from object storage's api package; Long.MAX_VALUE + ** when the bucket has no limit. Collaboration also enforces its per-table cap. *******************************************************************************/ public long maxBytes(String name) { - return (Long.MAX_VALUE); + Long max = bucket(name).maxUploadBytes(); + return (max == null ? Long.MAX_VALUE : max); } /******************************************************************************* -- 2.54.0