commit 27a742fdf449be0e2636f32b999e612705c363c4
parent f496cf482cba234103974143c7d5aeda24b4903b
Author: Michael Camilleri <[email protected]>
Date: Tue, 7 Jul 2026 13:01:23 +0900
Name join and completion notifications from the push payload
Join and completion (win/resign) notifications could fall back to 'A
player' even when the sender had a display name. The visible body is
rebuilt by the Notification Service Extension from the encrypted
PushPayload, and both paths supplied only the event there; the sender's
name was left behind in the old clear-text body path, so a recipient
holding no private nickname for the sender saw 'A player joined the
puzzle' or 'A player solved the puzzle' rather than their name.
This mirrors the earlier nudge fix. This commit carries the current
player name in the join and completion PushPayloads so the extension can
use it whenever the receiver has not set a nickname. Nicknames still win
because the rewrite path continues to prefer the receiver's local
nickname before falling back to payload.playerName.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Crossmate/Services/SessionCoordinator.swift b/Crossmate/Services/SessionCoordinator.swift
@@ -289,7 +289,7 @@ final class SessionCoordinator {
puzzleTitle: plan.title,
broadcast: true,
excludeAddress: excludeAddress,
- broadcastPayload: PushPayload(event: .join),
+ broadcastPayload: PushPayload(event: .join, playerName: preferences.name),
collapseID: PushClient.gameCollapseID(gameID),
body: PuzzleNotificationText.joinBody(
playerName: preferences.name,
@@ -447,7 +447,7 @@ final class SessionCoordinator {
let event: PushPayload.Event = resigned ? .resign : .win
let addressees = plan.recipients.compactMap { recipient in
recipient.pushAddress.map {
- PushClient.Addressee(address: $0, payload: PushPayload(event: event))
+ PushClient.Addressee(address: $0, payload: PushPayload(event: event, playerName: preferences.name))
}
}
guard !addressees.isEmpty else {