fix p2p topic canonicalization and stale subscriptions

This commit is contained in:
richjohnrambo
2026-09-12 00:08:30 +08:00
parent f1dfffcfb5
commit a9a4970d9f
9 changed files with 148 additions and 66 deletions
+2 -3
View File
@@ -100,9 +100,8 @@ func TestPreparePayloadsUsesAliasAndNormalizesP2PTopic(t *testing.T) {
if got := payload.Audience["alias"][0]; got != aliasForUid(callee) {
t.Fatalf("unexpected alias: %s", got)
}
userTopic, _ := types.P2PNameForUser(callee, topic)
if got := payload.Notification.Android.Extras["topic"]; got != userTopic {
t.Fatalf("topic was not normalized for callee: got %s want %s", got, userTopic)
if got := payload.Notification.Android.Extras["topic"]; got != topic {
t.Fatalf("topic was not kept canonical for callee: got %s want %s", got, topic)
}
if payload.Notification.IOS.Badge != "3" {
t.Fatalf("unexpected badge: %s", payload.Notification.IOS.Badge)