Skip to content

Bug: in-conversation notification suppression matches on group id alone, silently dropping a notification for the same MLS group under a different local identity #591

Description

@erskingardner

Severity

LOW (multi-account, same-group edge case — a missed notification, not a leak)

Summary

handleNotificationUpdate is a client-wide listener that fires for every local account. Its "don't notify me about the chat I'm already looking at" suppression checks only selectedChat?.id == update.groupIdHex (plus visibility) and never checks that update.accountIdHex belongs to the currently active account. selectedChat is always the active account's selection, while update can target any local identity. MLS group ids are globally unique, so if two of the user's local identities are both members of the same group, they share a groupIdHex.

Location / Evidence

whitenoise-mac/Core/WorkspaceState+Notifications.swift:48-50

if selectedChat?.id == update.groupIdHex, selectedConversationIsVisible() {
    return          // no check that update.accountIdHex == active account
}

Contrast: the settings-sync block just above (:37-44) does gate on the active account via ownsNotificationSettingsOperation(...); the suppression does not.

Failure scenario

  1. User has identities A and B, both members of group G (same groupIdHex).
  2. User is viewing G under account A (selectedChat.id == G, visible).
  3. A message arrives addressed to B in G. handleNotificationUpdate for B evaluates selectedChat?.id == update.groupIdHex → true, conversation visible → the notification for B is suppressed.
  4. The user is not actually reading B's copy of the conversation and receives no alert for B's message.

Why this is not a duplicate

Suggested fix

Gate the suppression on the active account as well:

if activeAccount?.accountIdHex == update.accountIdHex,
   selectedChat?.id == update.groupIdHex,
   selectedConversationIsVisible() {
    return
}

Found during a full-codebase review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LOWSeverity: LOWagent-okbugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions