Environment
Description
-
Problem
With subdomain identifier strategy + pod quota, quota is never enforced:
PodQuotaStrategy.searchPimStorage tests identifierStrategy.isRootContainer()
BEFORE reading metadata. In subdomain mode every pod root (e.g.
https://alice.example.com/) IS a root container, so discovery returns "no
storage" without checking the pim:Storage metadata. getTotalSpaceUsed
then returns MAX_SAFE_INTEGER → writes are never limited.
-
Repro
- Run with
css:config/util/identifiers/subdomain.json and
css:config/storage/backend/pod-quota-file.json.
- Create a pod (subdomain), write beyond the limit → write succeeds (no 413).
-
Root cause
PodQuotaStrategy.searchPimStorage (dist/storage/quota/PodQuotaStrategy.js)
returns early when isRootContainer(identifier), conflating "no parent
container above this" with "this container is not a pod". The metadata check
must come first: a root container CAN be a pod (it has pim:Storage).
-
Suggested fix
Check pim:Storage metadata before the root-container stop, and only fall
back to "no pod" after the metadata check at a root container:
// read metadata → if hasPimStorage return identifier
// else if isRootContainer return undefined
// else recurse to parent
Environment
with a pod quota counter strategy see https://github.com/solid-contrib/pivot/blob/pod-quota-counter/POD-STORAGE-QUOTA.md
Description
Problem
With subdomain identifier strategy + pod quota, quota is never enforced:
PodQuotaStrategy.searchPimStoragetestsidentifierStrategy.isRootContainer()BEFORE reading metadata. In subdomain mode every pod root (e.g.
https://alice.example.com/) IS a root container, so discovery returns "nostorage" without checking the
pim:Storagemetadata.getTotalSpaceUsedthen returns
MAX_SAFE_INTEGER→ writes are never limited.Repro
css:config/util/identifiers/subdomain.jsonandcss:config/storage/backend/pod-quota-file.json.Root cause
PodQuotaStrategy.searchPimStorage(dist/storage/quota/PodQuotaStrategy.js)returns early when
isRootContainer(identifier), conflating "no parentcontainer above this" with "this container is not a pod". The metadata check
must come first: a root container CAN be a pod (it has
pim:Storage).Suggested fix
Check
pim:Storagemetadata before the root-container stop, and only fallback to "no pod" after the metadata check at a root container: