fix(stream): recover from filter changes, unknown filters and stray polls - #2909
Open
solracsf wants to merge 1 commit into
Open
fix(stream): recover from filter changes, unknown filters and stray polls#2909solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
…olls Three faults in the feed, all reachable from normal use: - Changing filter while the first page was still loading left the stream wedged on its loading placeholder. The watcher aborts the in-flight request and reloads, but `loading` was still set, so the reload hit the re-entrancy guard and returned, while the aborted request's finally deliberately skips clearing the flag. Neither side ever cleared it. - An unknown filter in the URL threw out of the `headingTitle` computed and took the whole view down. Unknown filters now fall back to `all`, which is what `Data::validateFilter()` already does server-side. - Hiding and re-showing the tab while a poll was in flight started a second polling chain, because the returning request rescheduled itself even though `stopPolling()` had run. Chains now carry a generation token and a superseded one stops instead of running alongside its replacement. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Three faults in the feed, all reachable from normal use.
Filter change mid-load wedges the stream. Two guards cancel each other out. The watcher aborts the in-flight request and calls
loadActivities()synchronously, butloadingis stilltrueat that point, so the reload hits the re-entrancy guard and returns. The aborted request'sfinallythen deliberately skips clearing the flag, assuming the replacement call already set it. Neither happens, and the view sits on "Loading activities" forever.Unknown filter kills the view.
navigationList.find(...).namehad no guard, so any filter not in the navigation list threw out of a computed. Unknown filters now fall back toall, matching whatData::validateFilter()already does server-side.Duplicate polling chains.
stopPolling()can't cancel a request already in flight. Hiding and re-showing the tab during one leaves the returning request rescheduling itself alongside its replacement — two requests per interval, compounding with each repeat.The polling test measures the request count rather than asserting on timers, so it fails on the current code rather than passing vacuously.