Fix persistent and disappearing error badges for Inspector#9805
Open
khanak0509 wants to merge 5 commits intoflutter:masterfrom
Open
Fix persistent and disappearing error badges for Inspector#9805khanak0509 wants to merge 5 commits intoflutter:masterfrom
khanak0509 wants to merge 5 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the ErrorBadgeManager to use a derived-count model for the Inspector, where the badge count is automatically updated based on the number of unread errors. This change removes the need for manual badge count increments and the filterErrors logic in the InspectorController. A concern was raised regarding redundant calls to clearErrorCount remaining in the InspectorController files, which should be removed to maintain code clarity and align with the new error tracking model.
ebc60b7 to
161cb10
Compare
161cb10 to
ecbab42
Compare
ecbab42 to
4b2de64
Compare
srawlins
approved these changes
Apr 25, 2026
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.
issue #9524
This PR fixes issue #9524 where the Inspector error badge was acting weird — like it kept increasing incorrectly and sometimes disappeared on tab switch. The count was blindly incremented, errors were getting deleted due to aggressive filtering, and the badge was cleared too early.
How I fixed it:
Basically, I made the badge count derived from actual unread errors instead of manually incrementing it, removed the aggressive filtering, and stopped clearing the badge on tab switch — like now it only resets on a fresh connection or Hot Restart.
before
before.mov
after
after.mov
Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.