Rationale
BoundedMailbox implements drop-head overflow via super.dequeueUser() (src/mailbox/BoundedMailbox.ts:43-48). But Mailbox.dequeueUser() returns undefined without removing anything while the mailbox is suspended (src/internal/Mailbox.ts:49-52) — e.g. during a supervision restart or while a stash gate holds the actor. The overflow branch then still enqueues the new envelope:
- the "bounded" queue grows past
capacity for as long as the mailbox stays suspended under a flooding producer, and
droppedCount / onDrop (and any metric built on them) report drops that never happened.
Scope
- Drop from the underlying buffer regardless of suspension (e.g. a protected
removeOldest() on Mailbox that bypasses the suspended gate) — drop-new and reject semantics stay unchanged.
- Test: enqueue past capacity while suspended →
size === capacity and droppedCount matches actual removals; resume → normal delivery order.
Note (current state, v0.11): overflow values are 'drop-head' | 'drop-new' | 'reject' (default 'reject'), and BoundedMailboxOptions + BoundedMailboxOptionsValidator already exist — this issue only touches the suspended-drop logic.
Documentation
- CHANGELOG
Fixed entry.
- Mailbox docs note (EN + DE) on overflow semantics during suspension.
Acceptance
- Capacity invariant holds under suspend/resume; drop metric matches reality; existing mailbox tests green.
Relates
#310 (bounded default mailbox). Improvement program M1/S4.
Rationale
BoundedMailboximplementsdrop-headoverflow viasuper.dequeueUser()(src/mailbox/BoundedMailbox.ts:43-48). ButMailbox.dequeueUser()returnsundefinedwithout removing anything while the mailbox is suspended (src/internal/Mailbox.ts:49-52) — e.g. during a supervision restart or while a stash gate holds the actor. The overflow branch then still enqueues the new envelope:capacityfor as long as the mailbox stays suspended under a flooding producer, anddroppedCount/onDrop(and any metric built on them) report drops that never happened.Scope
removeOldest()onMailboxthat bypasses the suspended gate) —drop-newandrejectsemantics stay unchanged.size === capacityanddroppedCountmatches actual removals; resume → normal delivery order.Note (current state, v0.11): overflow values are
'drop-head' | 'drop-new' | 'reject'(default'reject'), andBoundedMailboxOptions+BoundedMailboxOptionsValidatoralready exist — this issue only touches the suspended-drop logic.Documentation
Fixedentry.Acceptance
Relates
#310 (bounded default mailbox). Improvement program M1/S4.