fix : refresh scan status badges automatically#1127
Conversation
|
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. |
|
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
left a comment
There was a problem hiding this comment.
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.
Description
This PR improves task list updates in the Scans page by creating a new array reference when updating the task state.
Changes Made
setTasks(data.tasks || []);
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
How Has This Been Tested?
Checklist