This problem seems to be an extension of the one I reported earlier in The flag counter in the 10k tools should reflect the posts I can actually see. This was reported earlier in Physics and has a duplicate here. I notice two changes since I posted the original thread:
The previously-handled threads do not immediately disappear but spend some time greyed out after being dealt with. When there are no flags to respond to, there is now a link saying show posts you've already flagged
instead of an unnerving blank screen. Thank you dev team!
The flag counter has been upgraded to a permanent spot on the top bar, even when the counter no longer reflects the number of flags the user can respond to. This was brought in by popular demand but it only works when the counter does. This makes the problem much worse: the flag counter on the top bar is there to reflect actions that can - ideally should - be taken. It is not meant to be a permanent staple that says "hey, maybe there's new flags for you to help with".
I know this is a hard problem to solve. To quote Jarrod's comment,
Currently, that number is cached for all privileged users and is updated for everyone when the flags are handled. Simply querying the database on each page load really isn't tenable, e.g. yesterday, that would have resulted in an extra 350K queries. So, a complex, per-user caching strategy needs to be implemented, one that knows what you've done and is updated when flags are handled.
When I reported this back in September, Shog9 indicated the dev team was already working on this with a six to eight weeks timeline. I know the dev team is again busy with further pressing matters but this is a big usability issue: there's (currently) a huge glaring yellow anywhere I go in Physics. It is distracting, and it does not achieve its purpose.
Please fix this! :)
Update:
One more reason why this needs to be fixed: say there are flags on the counter I can't see (nonactionable flags) because I've already dealt with that post, and then someone else puts an additional flag on that same post. Then the counter will go up, but I will be unable to see any new flags. (Or, at least, that's the behaviour I observe, and a reasonable explanation for it.) This means, though, that even monitoring the counter for increases need not indicate that there are actionable flags ready. Or, in other words, the counter is essentially useless on timescales shorter than the ~1 day it takes for flags to disappear.
posts_in_queue - posts_flagged_by_me > 0
, show the alert.