fix: keep sending notifications to users under a continuous stream of events - #758
Open
solracsf wants to merge 2 commits into
Open
fix: keep sending notifications to users under a continuous stream of events#758solracsf wants to merge 2 commits into
solracsf wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_ENABLEto false, so the debounce path is never exercised end to end.test_send_queue_sustained_updatesfails on master. The two existing queue tests areunchanged, which is what shows the coalescing behaviour is the same.