                             }
                         case .roomMember:
                             // If the current user is already joined, display updated displayname/avatar events.
+                            // This is an unexpected path, but has been seen in some circumstances.
                             if NotificationService.backgroundSyncService.roomSummary(forRoomId: roomId)?.membership == .join {
                                 notificationTitle = self.messageTitle(for: eventSenderName, in: roomDisplayName)
                                 

                                    notificationBody = NSString.localizedUserNotificationString(forKey: "USER_INVITE_TO_CHAT", arguments: [eventSenderName])
                                }
                            }
                        case .sticker:
                            notificationTitle = self.messageTitle(for: eventSenderName, in: roomDisplayName)
                            notificationBody = NSString.localizedUserNotificationString(forKey: "STICKER_FROM_USER", arguments: [eventSenderName as Any])
                        case .reaction:
                            notificationTitle = self.messageTitle(for: eventSenderName, in: roomDisplayName)
                            if let reactionKey = event.relatesTo?.key {

                                // Otherwise show a generic reaction.
                                notificationBody = NSString.localizedUserNotificationString(forKey: "GENERIC_REACTION_FROM_USER", arguments: [eventSenderName])
                            }
                            
                        case .custom:
                            if (event.type == kWidgetMatrixEventTypeString || event.type == kWidgetModularEventTypeString),
                               let type = event.content?["type"] as? String,
