iMessage badge bug

Why is it that iMessage displays its little read unread message badge when you don’t have any unread messages? It used to happen every so often—and then somehow clear itself after a day or two—but now it’s happening all the time and not clearing itself. So I have to check iMessages for new messages manually and that’s a PITA.

I’ve tried all the usual suggestions about sync’ing with iCloud and none of them seem to help. Why is this so hard?