Skip to content

fix(scans): ignore stale polling responses#416

Open
eshaanag wants to merge 6 commits into
utksh1:mainfrom
eshaanag:scans-polling-stale-415
Open

fix(scans): ignore stale polling responses#416
eshaanag wants to merge 6 commits into
utksh1:mainfrom
eshaanag:scans-polling-stale-415

Conversation

@eshaanag
Copy link
Copy Markdown
Contributor

Description

Prevents stale Scans page polling responses from overwriting the current task list after a newer request has already completed.

The Scans page now aborts superseded /tasks requests and uses a latest-request sequence guard before updating tasks, pagination, or loading state. This keeps polling, filter changes, page changes, and visibility refreshes from racing each other. I am contributing this under GSSoC.

Related Issues

Closes #415

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • npm test -- --run testing/unit/pages/Scans.polling.test.tsx
  • npm run typecheck
  • npm run build
  • git diff --check

Note: the existing Scans polling test suite emits React act(...) warnings that were present during the targeted run, but all assertions pass.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label area:frontend Frontend React/UI work labels May 29, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction, but this cannot merge while frontend-checks are failing. Please fix the Scans polling test/typecheck failures after the latest main changes, keep the abort/sequence guard behavior, and rerun the full frontend check job before re-review.

@eshaanag
Copy link
Copy Markdown
Contributor Author

Thanks for the review. I fixed the frontend-checks failure by updating the Scans phase test fetch fixtures to reflect successful responses after the new non-OK response handling. I also updated the branch with latest main and reran the full PR checks; artifact-check, formatting-hygiene, backend-lint, backend-tests, benchmark, and frontend-checks are all passing now. Could you please re-review when you get a chance?

@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented May 29, 2026

Current re-review note: frontend-checks are failing on the latest branch. Please fix the Scans polling test/typecheck failures after current main, keep the abort/sequence guard behavior, and rerun the full frontend check job before re-review.

@eshaanag
Copy link
Copy Markdown
Contributor Author

eshaanag commented May 29, 2026

Thanks for checking again. I re-verified the latest branch state after syncing with current main, and GitHub currently shows all checks passing on this PR: artifact-check, backend-lint, backend-tests, benchmark, formatting-hygiene, and frontend-checks.

I also reproduced the frontend-checks steps locally on the current branch:

  • npm run typecheck passed
  • npm run quality passed with the existing non-blocking animation warning
  • npm run test passed: 21 files / 189 tests
  • npm run build passed

I do not see a current failing frontend-checks run attached to this PR now. If you are seeing a different failing run, please point me to that job URL and I will inspect that exact log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Frontend React/UI work level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Scans polling can overwrite current view with stale responses

2 participants