Fixes#499. Five places where a tenant's usage didn't match what its accounts store:
CalDAV/CardDAV COPY and MOVE of one item into another account now check that account's quota and its tenant's, as copying a whole calendar or address book already did. These checks and the whole-collection check now use the size the item is actually charged, not the bare iCalendar or vCard length.
Usage follows the data's owner (MT-20). The index builder emits tenant changes with a placeholder when the writer has no tenant. commit_batch resolves each account's tenant (for a kept deleted account, from its kept record) and points the change there, or drops it. A sharee, a delegate or an administrator writing into someone's account no longer moves the wrong tenant's counter.
Destroying an account takes its usage off its tenant. The account's counter is read before the data goes and subtracted after, once, even if the destroy is retried.
Destroying an account no longer clears another tenant's counter. Accounts and tenants are numbered apart, and tenant N's counter key sat inside the range cleared for account N, so destroying account 5 zeroed tenant 5's usage. danger_destroy_account now skips that key.
A tenant recount includes deleted members still kept (UD-15).
No CHANGELOG entry: the next version PR adds it.
Tests
webdav Test 20: events and cards copied and moved one at a time into a group with 2 KiB left are refused once it's full. Before the fix, all 200 went in.
tenant suite: a kept member stays counted through a recount; destroying it for good takes its usage off; destroying an account numbered like a tenant leaves that tenant alone; a tenant with every member destroyed is back to 0.
store unit tests for the tenant retargeting.
Run serially (RocksDB): tenant, undelete, legal_hold, imap, webdav all pass.
Live check against a built server: a member copying and moving events into a group in a 64 KiB tenant is refused at the exact boundary, and usage stays inside the limit.
Left alone
A CalDAV/CardDAV PUT checks the raw body length while the item is charged a little more, so a PUT can go a few hundred bytes past a limit. It's a separate path, not changed here.
An account removed and not kept, whose destroy task hasn't run yet, is missed by a recount in that window; its destroy then takes its usage off again, so the counter can briefly read low.
Search index entries for an item moved away before its indexing task runs can be left behind (seen once in the webdav suite; Test 20 now waits for indexing between steps).
Part of the inbuxa/inbuxa-admin#257 remediation (Refs inbuxa/inbuxa-admin#257).
Fixes #499. Five places where a tenant's usage didn't match what its accounts store:
- **CalDAV/CardDAV COPY and MOVE of one item into another account** now check that account's quota and its tenant's, as copying a whole calendar or address book already did. These checks and the whole-collection check now use the size the item is actually charged, not the bare iCalendar or vCard length.
- **Usage follows the data's owner (MT-20).** The index builder emits tenant changes with a placeholder when the writer has no tenant. `commit_batch` resolves each account's tenant (for a kept deleted account, from its kept record) and points the change there, or drops it. A sharee, a delegate or an administrator writing into someone's account no longer moves the wrong tenant's counter.
- **Destroying an account takes its usage off its tenant.** The account's counter is read before the data goes and subtracted after, once, even if the destroy is retried.
- **Destroying an account no longer clears another tenant's counter.** Accounts and tenants are numbered apart, and tenant N's counter key sat inside the range cleared for account N, so destroying account 5 zeroed tenant 5's usage. `danger_destroy_account` now skips that key.
- **A tenant recount includes deleted members still kept** (UD-15).
No CHANGELOG entry: the next version PR adds it.
## Tests
- webdav Test 20: events and cards copied and moved one at a time into a group with 2 KiB left are refused once it's full. Before the fix, all 200 went in.
- tenant suite: a kept member stays counted through a recount; destroying it for good takes its usage off; destroying an account numbered like a tenant leaves that tenant alone; a tenant with every member destroyed is back to 0.
- store unit tests for the tenant retargeting.
- Run serially (RocksDB): tenant, undelete, legal_hold, imap, webdav all pass.
- Live check against a built server: a member copying and moving events into a group in a 64 KiB tenant is refused at the exact boundary, and usage stays inside the limit.
## Left alone
- A CalDAV/CardDAV PUT checks the raw body length while the item is charged a little more, so a PUT can go a few hundred bytes past a limit. It's a separate path, not changed here.
- An account removed and not kept, whose destroy task hasn't run yet, is missed by a recount in that window; its destroy then takes its usage off again, so the counter can briefly read low.
- Search index entries for an item moved away before its indexing task runs can be left behind (seen once in the webdav suite; Test 20 now waits for indexing between steps).
jcoffey-dev
added this to the 27.1 milestone 2026-11-20 19:13:08 +00:00
Part of the inbuxa/inbuxa-admin#257 remediation (Refs inbuxa/inbuxa-admin#257).
Five places where a tenant's usage didn't match what its accounts store:
- CalDAV/CardDAV COPY and MOVE of a single event or card into another
account now check that account's quota and its tenant's, as copying a
whole calendar or address book already did. A member could copy items
one at a time into a group account or a shared calendar past both
limits. A move within one account adds nothing and isn't checked.
Both checks, and the whole-collection one, now use the size the
item is charged (its stored bytes plus names and properties), not
the bare iCalendar or vCard length, so they don't run a few hundred
bytes per item past the limit.
- A tenant's usage counter now moves with the account that owns the
data, not the tenant of whoever made the change (MT-20). The index
builder still emits the change, with TENANT_OF_ACCOUNT when the writer
has no tenant; commit_batch looks up each account's tenant (a kept
deleted account's from its kept record) and points the change there,
or drops it for an account with none. A change still unresolved when
a batch is built is dropped rather than written under the
placeholder. Writes by a sharee, a delegate or a server
administrator no longer move the wrong tenant's counter, or none.
- Destroying an account takes its usage off its tenant: the account's
counter (kept archive bytes included) is read before the data goes
and subtracted after, so a retried destroy takes it off once. The
tenant comes from the kept record, or from the account's domain.
- Destroying an account no longer clears the usage counter of the
tenant with the same number. Accounts and tenants are numbered
apart, and the tenant's counter key sits inside the account's range
in the counter subspace, so destroying account 5 set tenant 5's
usage to 0. danger_destroy_account now skips that one key.
- A tenant recount (recalculateQuota, resetTenantQuotas, a domain
moving in) now includes deleted members still kept (UD-15): their
data stays until they're destroyed, which takes it off then.
Tests: webdav Test 20 (COPY/MOVE of events and cards into a group with
2 KiB left: refused once full; failed before the fix with 200 copies
in), store unit tests for the retargeting, and the tenant suite checks
a kept member stays counted through a recount, a destroyed one comes
off, destroying an account numbered like a tenant leaves that
tenant's usage alone, and a tenant with every member destroyed is back
to 0.
Fixes#499
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of the inbuxa/inbuxa-admin#257 remediation (Refs inbuxa/inbuxa-admin#257).
Fixes #499. Five places where a tenant's usage didn't match what its accounts store:
commit_batchresolves each account's tenant (for a kept deleted account, from its kept record) and points the change there, or drops it. A sharee, a delegate or an administrator writing into someone's account no longer moves the wrong tenant's counter.danger_destroy_accountnow skips that key.No CHANGELOG entry: the next version PR adds it.
Tests
Left alone