fix(scans): replace error banner with toast feedback for delete and rescan failures#1666
Open
NaitikVerma6776 wants to merge 2 commits into
Open
fix(scans): replace error banner with toast feedback for delete and rescan failures#1666NaitikVerma6776 wants to merge 2 commits into
NaitikVerma6776 wants to merge 2 commits into
Conversation
…d rescan failures
utksh1
requested changes
Jul 5, 2026
utksh1
left a comment
Owner
There was a problem hiding this comment.
The direction of this fix is correct — replacing setError() with addToast() for failure feedback is the right approach. However, it's incomplete:
1. Dead error banner code was left behind:
After replacing all setError(...) calls in catch blocks with addToast(...), the error banner infrastructure is now orphaned:
const [error, setError] = useState<string | null>(null)is still declared- The entire
{error && (<div role="alert" ...>) }JSX block is untouched - Several
setError(null)calls remain scattered (filter change, pagination, modal reset)
No catch block sets setError with a user-facing message anymore, making the banner dead code. Please remove:
- The
errorstate declaration - The
{error && (...)}JSX block - All
setError(null)calls that are now no-ops
2. Minor: ScansToastErrors.test.tsx is missing a trailing newline.
Once the dead code is cleaned up, this is a clean, well-tested fix that's ready to merge.
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.
Description
The Scans page was using setError() to display a persistent error banner for delete, clear-history, and bulk-delete failures, which was inconsistent with the rest of the app's non-blocking toast pattern. The rescan failure had no user feedback at all — only a console.error.
Changes:
Related Issues
Closes #1396
Type of Change
How Has This Been Tested?
All 28 tests across the full Scans test suite pass locally via npm test (Scans.test.tsx, Scans.polling.test.tsx, ScansPhases.test.tsx, ScansToastErrors.test.tsx).
Checklist