Skip to content

fix : refresh scan status badges automatically#1127

Open
kavin553 wants to merge 2 commits into
utksh1:mainfrom
kavin553:fix-scan-status-auto-refresh
Open

fix : refresh scan status badges automatically#1127
kavin553 wants to merge 2 commits into
utksh1:mainfrom
kavin553:fix-scan-status-auto-refresh

Conversation

@kavin553

Copy link
Copy Markdown

Description

This PR improves task list updates in the Scans page by creating a new array reference when updating the task state.

Changes Made

  • Replaced:
    setTasks(data.tasks || []);
  • With:
    setTasks([...(data.tasks || [])]);

This ensures React receives a new array reference on every polling cycle and reliably re-renders the task list when task statuses change.

Related Issues

Closes #1041

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?

  1. Started the frontend using "npm run dev".
  2. Started a scan task.
  3. Monitored task status updates on the Scans page.
  4. Verified that task status changes are reflected correctly during polling.
  5. Confirmed no build or runtime errors were introduced.

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.

@kavin553

Copy link
Copy Markdown
Author

Implemented a frontend state update improvement to ensure task status changes are reflected consistently during polling cycles. Verified that scan records update correctly without requiring a manual page refresh. Tested across multiple scan executions and confirmed no regressions or build issues. Closes #1041.

@kavin553

Copy link
Copy Markdown
Author

Hello maintainers 👋

I investigated the CI failure and updated the polling implementation to align with the expected behavior. All checks are now passing, and the scan status badges continue to refresh correctly during polling.

Thank you for your review and feedback. 🚀

@utksh1 utksh1 added level:beginner 20 pts difficulty label for small beginner-friendly PRs type:bug Bug fix work category bonus label area:frontend Frontend React/UI work labels Jun 20, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Requesting changes. The patch leaves a console.log in production code and changes formatting around the polling callback without adding a regression test. Please remove debug logging, restore normal formatting, and add focused coverage or a clear explanation of how the status badge refresh is verified.

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:beginner 20 pts difficulty label for small beginner-friendly PRs type:bug Bug fix work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Scan status badges do not update automatically after long-running scans finish

2 participants