Skip to content

fix: keep sending notifications to users under a continuous stream of events - #758

Open
solracsf wants to merge 2 commits into
nextcloud:mainfrom
solracsf:fix/debounce-starvation
Open

fix: keep sending notifications to users under a continuous stream of events#758
solracsf wants to merge 2 commits into
nextcloud:mainfrom
solracsf:fix/debounce-starvation

Conversation

@solracsf

@solracsf solracsf commented Sep 7, 2026

Copy link
Copy Markdown
Member

The send queue only released a message once its slot had been quiet for 100ms. A user
whose storages are written to continuously keeps refreshing that timestamp, so the
message is never sent at all and the client stays silent for as long as the activity
lasts.

The existing tests do not catch this because the integration suite sets
DEBOUNCE_ENABLE to false, so the debounce path is never exercised end to end.

test_send_queue_sustained_updates fails on master. The two existing queue tests are
unchanged, which is what shows the coalescing behaviour is the same.

The send queue only released a message once no update had landed in that slot
for 100ms. That works for a short burst, but a user whose storages are being
written to continuously (a bulk upload, a busy groupfolder) keeps refreshing
`received` and the message is never handed out at all, so the client stops
getting notified for as long as the activity lasts.

Track when a message was first queued and release it once it has waited the
full debounce time, regardless of whether the burst has settled.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
`if let`/`else` on the slot removes the `first` flag and the catch-all arm that
only existed to dodge a borrow. Early returns replace the nested condition, and
the 100ms settle delay gets a name instead of appearing as a literal in the
middle of a boolean.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant