Repository navigation
fix(web): prevent stale responses from overwriting results - #682
Merged
gkhngyk merged 1 commit intoAug 8, 2026
Merged
Conversation
7 of 12 tasks
gkhngyk
approved these changes
Aug 8, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Clean implementation of #663 — isCancelled checked after the await, setLoading guarded in finally, cleanup in the effect. Approving.
One non-blocking suggestion worth a follow-up commit (here or later): the catch still toasts unconditionally, so a request aborted by navigating away can pop "Failed to load content opportunities" on the next page — the same symptom we just filed for Citations in #684. An early if (isCancelled?.()) return 0; at the top of the catch closes it.
Heads-up: #681 modifies the same loadData/effect — coordinate the merge order between your two branches.
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.
Summary
Prevent stale content opportunity requests from overwriting the table when filters change rapidly.
The content data loader now uses an effect-scoped cancellation flag to ensure that only the latest request can update the opportunities and pagination state. Stale requests are also prevented from changing the loading state after they become outdated.
Related issue
Closes #663
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/) — see https://github.com/ansvisor/ansvisor/blob/main/CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)