You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: persistent unread badges + group name corruption
Unread badge persists after hard refresh:
- Track markedReadAt[jid] = lastMsgTimestamp when user reads a chat
- Persist markedReadAt to localStorage so it survives page reloads
- chatFetchConversations zeroes unreadCount for any jid where no newer
message has arrived since it was marked read (normalised to ms for
mixed ISO/Unix timestamp safety)
- Badge correctly reappears when a genuinely new message arrives
Group names showing individual person names instead of group subject:
- Root cause: findChats pushName = last sender's name, not group subject
- Fix fallback order: verifiedName → c.subject → c.name (pushName excluded)
- Persist _verifiedGroupNames to localStorage so correct names load
instantly on hard refresh without waiting for async API call
- Remove one-time _groupSubjectsFetched gate; now retries only unverified
groups each load so transient 404s are recovered on next visit
- All 14 groups now resolve to correct subject names immediately
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
activeFilter: 'all',// all | unread | favorites | groups
3937
3937
typingTimer: null,
3938
3938
initialized: false,
3939
-
_verifiedGroupNames: {},// in-memory only; populated by chatFetchGroupSubjects
3939
+
_verifiedGroupNames: (()=>{try{returnJSON.parse(localStorage.getItem('chat_verifiedGroupNames')||'{}');}catch(e){return{};}})(),// persisted in localStorage
3940
3940
_failedPicUrls: newSet(),// URLs that returned 403/error — skip on future renders
3941
3941
selectMode: false,
3942
3942
selectedMsgs: newSet(),
3943
+
markedReadAt: (()=>{try{returnJSON.parse(localStorage.getItem('chat_markedReadAt')||'{}');}catch(e){return{};}})(),// jid → lastMsgTimestamp; persisted in localStorage
3943
3944
};
3944
3945
3945
3946
// ── Avatar colors (deterministic by jid) ─────────────────────────────
0 commit comments