↑↓ to navigate Enter to open "…" all these words ANDOR to combine

Architecture Decision Record

ADR-044: Native Push Delivery (the Third Notification Channel)

Status

Accepted (2026-07-11). Amends ADR-024. The framework pipeline is implemented and inert by default; each consumer switches it on by provisioning a notification hub with platform credentials and enabling the NativePush configuration section. Revised 2026-10-01 (UI.Maui ships credentialed FCM/APNs token providers and token-rotation re-registration; see Revision below). Revised 2026-10-06: the device DELETE route is /Notifications/Devices/{installationId}. Revised 2026-10-07: anchors refreshed after the v1.233.0 release. Revised 2026-10-21: anchors refreshed after the releases that moved the device controller, the registration service and the registrar. Revised 2026-10-24: the Notification Hubs sender and registrar moved to MMCA.Common.Azure, registered by AddAzureNotificationHubsPush (ADR-134); see Revision (2026-10-24). Revised 2026-10-25: two more delivery adapters ship, SNS mobile push over a DynamoDB registry (MMCA.Common.Aws) and FCM HTTP v1 over a Firestore registry (MMCA.Common.Gcp), and the payload builders moved into the core; see Revision (2026-10-25). Revised 2026-10-26: anchors refreshed after the releases that moved the SNS sender and registrar and the core payload builders. Revised 2026-10-28: the hub-call cost consequence is scoped to the Notification Hubs adapter, with the SNS per-endpoint cost beside it, and the native-leg anchor is corrected. Revised 2026-11-07: INativePushSender.BroadcastAsync and the SNS and FCM broadcast topics are removed (breaking), and the Notification Hubs sender attempts every chunk on both platforms and rethrows the collected failures at the end; see Revision (2026-11-07). Revised 2026-11-07 (v1.280.0, breaking): SendToUsersAsync returns a per-platform NativePushOutcome instead of throwing, and the handler records it on each notification for a "Phone delivery" column; see Revision (2026-11-07): per-platform outcome. Revised 2026-11-23: anchors refreshed after the releases since v1.280.0 that moved the registrar interface, the three adapters' registration calls, senders and registrars, the startup tripwire and the client sign-out leg. Revised 2026-12-05 (MMCA.Common v1.335.0): the client asks for notification permission outside the registration lock, bounds the FCM token fetch at 10 seconds and still sends the sign-out DELETE after a 5-second lock wait, and the device endpoints refuse a malformed installation id with 400 PushDevice.InvalidInstallationId; the Decision is corrected in place.

Context

ADR-024 established two notification channels: a durable per-user UserNotification inbox (the source of truth) and a transient SignalR push behind IPushNotificationSender. Both stop at the edge of a connected client: a phone with the app backgrounded, killed, or offline hears nothing until the next launch. Conference announcements ("lunch is served", "room change") are exactly the messages that must reach pockets, not open tabs.

OS-level delivery needs three things the framework did not have: a per-device registration store keyed to users, a sender that speaks FCM v1 (Android) and APNs (iOS), and a client-side lifecycle that registers the device after sign-in and unregisters it before sign-out. It also needs credentials (a Firebase service account, an APNs auth key) that cannot live in source and may not exist when the code ships.

Decision

  • Two Application abstractions, Null by default (the ADR-024 pattern): INativePushSender (user-targeted native sends only, SendToUsersAsync, returning a NativePushOutcome; MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/INativePushSender.cs:12, :26) and IPushDeviceRegistrar (installation upsert/delete, MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/IPushDeviceRegistrar.cs:12, UpsertAsync at :30, DeleteAsync at :49, and DeleteAllForUserAsync at :66, which removes every installation one user holds). AddInfrastructure TryAdds no-op defaults.
  • Account erasure removes the user's devices. DeleteUserHandlerBase takes an optional IInternalCommandScheduler (MMCA.Common/Source/Core/MMCA.Common.Application/Users/UseCases/DeleteUser/DeleteUserHandlerBase.cs:103) and, when one is supplied, schedules DeleteUserPushInstallationsInternalCommand in the erasure's unit of work (:195-198; the command at DeleteUserPushInstallationsInternalCommand.cs:18). Its handler calls DeleteAllForUserAsync (DeleteUserPushInstallationsInternalCommandHandler.cs:31), so a failure retries as a durable internal command (IPushDeviceRegistrar.cs:62-64). Every registrar implements it: the Null default (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NullPushDeviceRegistrar.cs:25), Azure Notification Hubs by listing the user's installations (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubDeviceRegistrar.cs:122-143), SNS through the UserId index (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsPushDeviceRegistrar.cs:128-141) and FCM through its Firestore registry query (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushDeviceRegistrar.cs:102-120). ADC runs erasure on its Identity service, which registers AddAzureNotificationHubsPush so the registrar reaches the hub devices register in (MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:230-234), and its DeleteUserHandler forwards the scheduler (MMCA.ADC/Source/Modules/Identity/MMCA.ADC.Identity.Application/Users/UseCases/DeleteUser/DeleteUserHandler.cs:44). Store forwards it too (MMCA.Store/Source/Modules/Identity/MMCA.Store.Identity.Application/Users/UseCases/DeleteUser/DeleteUserHandler.cs:41-42).
  • Three delivery adapters, one registration call each. Each call implements both abstractions and swaps them in only when NativePush:Enabled is true AND its own section is complete, so hosts call it unconditionally and deployments flip the channel on by configuration alone:
    • Azure Notification Hubs, AddAzureNotificationHubsPush(configuration) (MMCA.Common.Azure), gated on ConnectionString and HubName. One hub abstracts both platforms behind one API, holds the platform credentials outside our code, and its installation model gives upsert semantics with client-generated stable ids. The free tier covers conference volumes.
    • AWS SNS mobile push, AddAmazonSnsPush(configuration) (MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:174), gated on NativePush:Sns carrying InstallationsTable and at least one of FcmPlatformApplicationArn / ApnsPlatformApplicationArn (:150-158, :180-182; .../MMCA.Common.Aws/Notifications/SnsNativePushSettings.cs:51-53). SNS keeps no owner per endpoint, so a DynamoDB table is the installation registry: partition key InstallationId, global secondary index UserId-index on UserId (:161-163; .../MMCA.Common.Aws/Notifications/SnsInstallationRegistry.cs:29). The ownership and handover rule is one conditional write, attribute_not_exists(InstallationId) OR UserId = :me OR PushChannel = :channel (SnsInstallationRegistry.cs:36, applied at :92), so it holds under concurrency without a lock. Endpoints are subscribed to no topic (the broadcast topic was removed; see Revision (2026-11-07)), and an endpoint SNS reports disabled or missing is removed with its row on send (SnsNativePushSender.cs:95-99, :111).
    • Google FCM HTTP v1, AddFirebaseCloudMessagingPush(configuration) (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/GcpServiceCollectionExtensions.cs:149), gated on NativePush:Fcm carrying ProjectId and InstallationsCollection (:130-132, :155-157; .../MMCA.Common.Gcp/Notifications/FcmNativePushSettings.cs:28-30), with Application Default Credentials. A Firestore collection is the registry, one document per installation id, and every ownership decision is a Firestore transaction (.../MMCA.Common.Gcp/Notifications/FirestoreInstallationRegistry.cs:10-12, :45). Only FCM registration tokens are accepted: an APNs-platform registration fails validation with PushDevice.UnsupportedPlatform (Notifications/FcmPushDeviceRegistrar.cs:33-39), so an iOS client registers its FCM token on this adapter. The registrar subscribes tokens to no topic (see Revision (2026-11-07)), and a send that reports the token unregistered, or names it as an invalid registration token, prunes the installation (Notifications/FcmSendOutcome.cs:25-28, FcmNativePushSender.cs:70-73). The token target is set under a scoped CS0618 suppression (Notifications/FcmPushMessage.cs:31-37): FirebaseAdmin 3.6+ deprecates Message.Token in favour of Firebase installation ids (FIDs), kept deliberately because this adapter registers FCM registration tokens and the FCM HTTP v1 API still accepts a token target. The exit is moving registration and send to FIDs together.
  • A lost adapter call fails startup. NativePush:Enabled=true while INativePushSender is still the Null sender fails validation with a message naming all three calls and their keys (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:77-82, message at :81).
  • Sends target users, never raw tokens; a user's every device gets the message. On Notification Hubs installations are tagged user:{id} and tag expressions are OR-chunked at the hub's 20-tag cap (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/NativePushUserTags.cs:11,20, unit-tested), so audience size is unbounded. The SNS and FCM registries look installations up by their UserId field instead (SnsInstallationRegistry.cs:122-123; Firestore queries at most 30 users at a time, FirestoreInstallationRegistry.cs:23).
  • One payload shape in the core. NativePushPayloads.BuildFcmV1Payload and BuildApnsPayload are public in MMCA.Common.Infrastructure.Notifications.Push (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NativePushPayloads.cs:13,20,42), called by the Notification Hubs sender (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:32-33) and the SNS message builder (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsPushMessage.cs:29-30). The FCM adapter maps the same fields onto FirebaseAdmin's typed Message instead of raw JSON (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushMessage.cs:7-9, :41-61), with a test pinning the equivalence.
  • SendPushNotificationHandler gains the third leg. After the inbox write and the SignalR attempt, it calls INativePushSender.SendToUsersAsync inside its own non-fatal catch. The audit status (Sent/Failed) stays owned by the SignalR leg: the inbox remains the source of truth, and a hub outage must not fail the command or the other channels.
  • DevicesController (PUT /Notifications/Devices, DELETE /Notifications/Devices/{installationId}, DevicesController.cs:27,36,66) ships in MMCA.Common.API via the existing AddNotificationControllers application part, [Authorize] for any signed-in user and feature-gated with the same Notification.PushNotifications flag as the rest of the pipeline. Ownership is stamped server-side from the current user; installation ids are client-generated GUIDs (not enumerable), and both actions refuse an id that fails DeviceInstallationId.IsValid (1 to 128 characters of [A-Za-z0-9_-], MMCA.Common/Source/Core/MMCA.Common.Shared/Notifications/PushNotifications/DeviceInstallationId.cs:16, :24-25) with 400 PushDevice.InvalidInstallationId (DevicesController.cs:50-52, :80-82, :89-91), so a route value that bypasses the request record cannot carry / or .. into a registry key. DELETE is idempotent and owner-scoped: IPushDeviceRegistrar.DeleteAsync(userId, installationId, ct) takes the owning user, and an unknown id and another user's id both answer success without deleting anything.
  • Client orchestration behind two UI capability contracts (ADR-042 pattern): IPushRegistrationService (register after sign-in, unregister BEFORE sign-out - the delete call is authenticated) and IPushDeviceTokenProvider (the platform token extension point). UI.Maui ships MauiPushRegistrationService (stable installation id in IDevicePreferences, sync over the named API client, with a SemaphoreSlim serializing registration passes, MMCA.Common/Source/Presentation/MMCA.Common.UI.Maui/Capabilities/Notifications/MauiPushRegistrationService.cs:26). A pass first asks the token provider for the platform's notification permission, IPushDeviceTokenProvider.RequestPermissionAsync (MMCA.Common/Source/Presentation/MMCA.Common.UI/Services/Capabilities/Notifications/IPushDeviceTokenProvider.cs:22), OUTSIDE the registration lock and with no timeout, because the prompt waits on the user (MauiPushRegistrationService.cs:54-55); the non-interactive token fetch is bounded at 10 seconds on both platforms (FcmPushDeviceTokenProvider.cs:40, :78-80; ApnsPushDeviceTokenProvider.cs:32). UnregisterAsync waits at most 5 seconds for a pass in flight and, on timeout, still sends the DELETE for the stored installation id without the lock (MauiPushRegistrationService.cs:32, :127-153), so a stuck registration cannot leave the device row bound to a signed-out user. The token provider defaults to NullPushDeviceTokenProvider (TryAdd, MMCA.Common.UI/Services/Capabilities/DependencyInjection.cs:68); the opt-in AddMauiPushDeviceTokenProvider() (MMCA.Common.UI.Maui/DependencyInjection.cs:163-171) replaces it with FcmPushDeviceTokenProvider on Android (gated on the Push:Fcm section, FcmPushDeviceTokenProvider.cs:33, :99) and ApnsPushDeviceTokenProvider on iOS/MacCatalyst (gated on Push:Apns:Enabled, ApnsPushDeviceTokenProvider.cs:30, :41), while the windows TFM keeps the Null default. A build WITHOUT push credentials is therefore wired but inert end to end. PushRegistrationListener (rendered through the host layout extension point) re-registers on auth-state changes, and on Android MauiFirebaseMessagingService.OnNewToken re-registers when FCM rotates the token (MauiFirebaseMessagingService.cs:26-35). AuthUIService owns the unregister leg: LogoutAsync and RevokeAllSessionsAsync both call UnregisterPushAsync before the local sign-out (AuthUIService.cs:103,159, defined at :512).

Consequences

  • On Notification Hubs, sends fan out per 20-user chunk and per platform: an audience of N users costs ceil(N/20) * 2 hub calls. Acceptable at conference scale; a template-based send can consolidate later without touching callers. The SNS adapter instead costs at least one DynamoDB query per distinct user (the registry pages until LastEvaluatedKey is empty, SnsInstallationRegistry.cs:112-147, LastEvaluatedKey at :140) plus one publish per distinct endpoint (SnsNativePushSender.cs:65-72, PublishAsync at :85-92), and a disabled or missing endpoint adds its removal calls (SnsNativePushSender.cs:116-120). The FCM adapter costs one Firestore query per 30 distinct users (FcmNativePushSender.cs:40,94, FirestoreInstallationRegistry.cs:23,76) plus one SendEachAsync per 500 distinct tokens (FcmNativePushSender.cs:48,54, IFcmMessagingClient.cs:17).
  • On Notification Hubs one failing send does not stop the rest. Every 20-tag chunk is attempted on both platforms; a failure is counted and the loop continues, and the counts and the first failure come back in the outcome rather than as an exception (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:40-66, :71-84). The caller's own cancellation is not counted and stops the loop (:78).
  • The handler's third leg is best-effort: it is awaited inside a non-fatal catch (MMCA.Common/Source/Core/MMCA.Common.Application/Notifications/PushNotifications/UseCases/Send/SendPushNotificationHandler.cs:153-190), with per-platform counts recorded on the notification but no per-device delivery tracking. Because SendPushNotificationCommand is ITransactional, a transient fault on the final status save re-runs the live legs under the execution strategy, so native delivery is at-least-once and a device can receive the same OS push twice (SendPushNotificationHandler.cs:21-30). The observability surface is the vendor's delivery telemetry plus each adapter's own log messages (for SNS, SnsNativePushSender.cs:128-141; for FCM, FcmNativePushSender.cs:126-142); the inbox remains the recovery path.
  • A delete verifies ownership before it acts: the registrar reads the installation and checks the user:{id} tag UpsertAsync stamped on it (AzureNotificationHubDeviceRegistrar.cs:90-98, unknown-id success at :101-105), so an id belonging to someone else deletes nothing. That costs an extra hub round trip per delete, and the response cannot tell a caller which case it hit: an unknown id and a foreign one both answer success, deliberately, so the endpoint is not an existence oracle for other users' installation ids.
  • Consumers must update PRIVACY.md/store data-safety forms (push tokens are device identifiers) BEFORE store metadata mentions push. Credential provisioning (Firebase service account, APNs key) is a manual runbook step per app; until done, the hub rejects sends and the client token provider yields nothing - both by design.
  • SendPushNotificationHandler gained a constructor parameter (DI-resolved; source-compatible for every host, breaking only for code constructing it manually - none known).

Revision (2026-10-01)

The client half of the pipeline is no longer Null-only. MMCA.Common.UI.Maui ships credentialed token providers behind the opt-in AddMauiPushDeviceTokenProvider() (MMCA.Common.UI.Maui/DependencyInjection.cs:118-126): FcmPushDeviceTokenProvider on Android, which yields nothing unless the four Push:Fcm values are present (FcmPushDeviceTokenProvider.cs:33,43-49), and ApnsPushDeviceTokenProvider on iOS/MacCatalyst, gated on Push:Apns:Enabled (ApnsPushDeviceTokenProvider.cs:30,37) and fed by ApnsTokenBridge. The windows TFM registers nothing and keeps the NullPushDeviceTokenProvider TryAdd default (MMCA.Common.UI/Services/Capabilities/DependencyInjection.cs:62), so the inert-without-credentials property holds. Android also gains a second registration trigger: MauiFirebaseMessagingService re-registers on FCM token rotation (MauiFirebaseMessagingService.cs:26-35), and MauiPushRegistrationService serializes concurrent passes with a SemaphoreSlim (MauiPushRegistrationService.cs:24,41). The unregister leg runs from both LogoutAsync and RevokeAllSessionsAsync (AuthUIService.cs:90,134,320). The Consequences entry on the third leg now reads best-effort rather than fire-and-forget: the native send is awaited inside a non-fatal catch, and because SendPushNotificationCommand is ITransactional a retried final save re-runs the live legs, making native delivery at-least-once (SendPushNotificationHandler.cs:21-29,158-171). The server-side decision (Notification Hubs, user:{id} tags, the Null-by-default sender and registrar) is unchanged.

Revision (2026-10-06)

  • The Decision entry on DevicesController now names the DELETE route correctly: PUT is the bare /Notifications/Devices route and DELETE is /Notifications/Devices/{installationId} (DevicesController.cs:22,31,55).
  • Anchors in the live sections were re-verified against current source: AddMauiPushDeviceTokenProvider() is now MMCA.Common.UI.Maui/DependencyInjection.cs:124-132, the unregister calls are AuthUIService.cs:90,143 (definition at :342), and the handler's native leg and at-least-once remarks are SendPushNotificationHandler.cs:141-154 and :21-30.

Revision (2026-10-07)

Re-verified against current source. The decision is unchanged: Notification Hubs, user:{id} tags, the Null-by-default sender and registrar, and the unregister leg running before the local sign-out in both LogoutAsync and RevokeAllSessionsAsync. Only one anchor moved.

  1. Anchors re-verified against current source: the unregister calls stay at AuthUIService.cs:90,143 (each ahead of SignOutLocallyAsync at :101 and :144), and UnregisterPushAsync is now defined at AuthUIService.cs:361.

Revision (2026-10-21)

Re-verified against current source. The decision is unchanged: Notification Hubs, user:{id} tags, the Null-by-default sender and registrar, the owner-scoped idempotent DELETE, and the unregister leg running before the local sign-out. Only anchors in the live sections moved.

  1. Anchors re-verified against current source: DevicesController routes are now DevicesController.cs:22,35,60 ([Route] at :22, [HttpPut] at :35, [HttpDelete("{installationId}")] at :60); the registration SemaphoreSlim and its WaitAsync are MauiPushRegistrationService.cs:27,44; and the delete ownership check (read the installation, check the user:{id} tag, then delete) is AzureNotificationHubDeviceRegistrar.cs:84-92, with the unknown-id success path at :95-99. AddMauiPushDeviceTokenProvider() stays at MMCA.Common.UI.Maui/DependencyInjection.cs:124-132, the unregister calls at AuthUIService.cs:90,143 (defined at :361), and the handler's native leg and at-least-once remarks at SendPushNotificationHandler.cs:141-154 and :21-30.

Revision (2026-10-24)

ADR-134 moves the Notification Hubs implementation out of MMCA.Common.Infrastructure into the MMCA.Common.Azure adapter. The decision is unchanged: the Null-by-default sender and registrar, the NativePush section enabled AND complete as the gate, and user:{id} tags.

  1. Registration renamed. AddNativePushNotifications(configuration) is now AddAzureNotificationHubsPush(configuration) (MMCA.Common/Source/Hosting/MMCA.Common.Azure/AzureServiceCollectionExtensions.cs:83), with the same gate on Enabled, ConnectionString and HubName (:91-:96) before it registers the sender and registrar (:101-:102).
  2. Types moved. AzureNotificationHubNativePushSender (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:14) and AzureNotificationHubDeviceRegistrar (Notifications/AzureNotificationHubDeviceRegistrar.cs:15) live in MMCA.Common.Azure.Notifications, and NativePushSettings is now AzureNotificationHubSettings (Notifications/AzureNotificationHubSettings.cs:9). The NativePush section and its keys are unchanged (MMCA.Common/CHANGELOG.md:25).
  3. A lost call fails startup. NativePush:Enabled=true while INativePushSender is still the Null sender fails ValidateOnStart, naming the call (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:33, :48-:53).
  4. Corrected in place: the Decision bullet that named AddNativePushNotifications(configuration). The registrar anchors inside the 2026-10-21 revision point at the file's earlier Infrastructure location and are left as recorded.

Revision (2026-10-25)

MMCA.Common v1.257.0 adds two native push adapters beside Notification Hubs (MMCA.Common/CHANGELOG.md:14, :20). The pipeline is unchanged: the Null-by-default sender and registrar, the NativePush:Enabled gate, user-targeted sends, the owner-scoped idempotent DELETE and the client lifecycle. The Decision now describes three adapters.

  1. SNS mobile push (AddAmazonSnsPush, MMCA.Common.Aws) over a DynamoDB installation registry with the UserId-index global secondary index, the ownership and handover rule as one conditional write, a broadcast topic, and disabled-endpoint pruning on send (anchors in the Decision).
  2. FCM HTTP v1 (AddFirebaseCloudMessagingPush, MMCA.Common.Gcp) over a Firestore registry updated inside transactions. FCM registration tokens only: an APNs-platform registration fails validation. Broadcast uses an FCM topic, and unregistered tokens are pruned on send.
  3. Payload builders moved into the core. NativePushPayloads.BuildFcmV1Payload and BuildApnsPayload are public in MMCA.Common.Infrastructure.Notifications.Push, with output byte-identical to the former Azure-internal builders (MMCA.Common/CHANGELOG.md:26). The 20-tag chunking stays in the Azure adapter as NativePushUserTags (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/NativePushUserTags.cs:8); the Decision bullet that credited it to NativePushPayloads is corrected in place.
  4. The startup tripwire names all three calls (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:53, MMCA.Common/CHANGELOG.md:33).
  5. Scoped CS0618 suppression on Message.Token (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushMessage.cs:37-39, rationale and exit at :31-36): FirebaseAdmin 3.6+ deprecates tokens for FIDs, while the topic-subscription APIs take tokens only. The exit is moving registration and send to FIDs together.
  6. Rejected alternative: registry rows in each consumer's own database. Keeping the SNS and FCM installations as rows in each consumer's database was weighed on 2026-10-24 and rejected (a design decision recorded here, not in source): an adapter-owned table would need a migration and a PR in every consumer that enables push, and the adapter would no longer hold everything its capability needs. Revisit if a consumer must keep installation data inside its own database for a residency or audit reason. The registries are vendor-side resources provisioned outside the application instead (MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:150, MMCA.Common/Source/Hosting/MMCA.Common.Gcp/GcpServiceCollectionExtensions.cs:128-129).
  7. The Consequences entries on hub-call cost (ceil(N/20) * 2) and on the tag-based delete check describe the Notification Hubs adapter. The SNS and FCM registrars enforce the same owner-scoped delete and channel handover through the DynamoDB condition and the Firestore transaction (AwsServiceCollectionExtensions.cs:134-136, GcpServiceCollectionExtensions.cs:113-115).

Revision (2026-10-26)

Re-verified against current source. The decision is unchanged: three delivery adapters, the Null-by-default sender and registrar, the NativePush:Enabled gate, and one payload shape in the core. Only anchors in the live sections moved.

  1. Anchors re-verified against current source: the SNS broadcast topic subscription is MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsPushDeviceRegistrar.cs:157-167 (TopicArn = options.Value.BroadcastTopicArn at :162); the single broadcast publish is Notifications/SnsNativePushSender.cs:73-80 inside BroadcastAsync (:71); the disabled or missing endpoint pruning is SnsNativePushSender.cs:99-102; and NativePushPayloads, BuildFcmV1Payload and BuildApnsPayload are MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NativePushPayloads.cs:13,20,42. The AddMauiPushDeviceTokenProvider() anchor inside the 2026-10-01 revision is left as recorded; the live Decision already cites MMCA.Common.UI.Maui/DependencyInjection.cs:124-132.

Revision (2026-10-28)

Re-verified against current source. The decision is unchanged: three delivery adapters, the Null-by-default sender and registrar, the NativePush:Enabled gate, and the best-effort native leg with at-least-once delivery. One Consequences entry is scoped and one anchor moved.

  1. Send cost scoped per adapter. The Consequences entry on ceil(N/20) * 2 calls now names Notification Hubs, since the Decision describes three adapters, and gives the other two beside it. The SNS sender costs at least one DynamoDB query per distinct user, because QueryByUserAsync pages until LastEvaluatedKey is empty (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsInstallationRegistry.cs:117-151), plus one publish per distinct endpoint (Notifications/SnsNativePushSender.cs:45-64), with stale-endpoint removal calls on top (:120-123). The FCM sender costs one Firestore query per 30 distinct users and one SendEachAsync per 500 distinct tokens (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmNativePushSender.cs:39,43,57,63, FirestoreInstallationRegistry.cs:23,76, IFcmMessagingClient.cs:17).
  2. Observability no longer credited to the hub alone. The same Consequences entry now names each adapter's log messages beside the vendor telemetry (SnsNativePushSender.cs:67,132-148, FcmNativePushSender.cs:116-134).
  3. Anchors re-verified against current source: the handler's native leg is MMCA.Common/Source/Core/MMCA.Common.Application/Notifications/PushNotifications/UseCases/Send/SendPushNotificationHandler.cs:140-153 (try at :140, SendToUsersAsync at :142, catch at :149), and the at-least-once remark stays at :21-30. Anchors inside earlier revisions are left as recorded: the CHANGELOG lines, the 2026-10-01 anchors, and the native-leg range SendPushNotificationHandler.cs:141-154 in the 2026-10-06 and 2026-10-21 revisions.

Revision (2026-11-07)

Two breaking removals and one delivery fix in the Common release after v1.277.0 (MMCA.Common/CHANGELOG.md:9). User-targeted sends, the three adapters, the Null defaults and the best-effort native leg are unchanged.

  1. BroadcastAsync is removed. INativePushSender now declares SendToUsersAsync alone (MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/INativePushSender.cs:12, :21), and the method is gone from NullNativePushSender, the Notification Hubs sender and the SNS and FCM senders. No first-party host called it. A class of a consumer's own that implements the interface deletes its BroadcastAsync; a caller has no replacement.
  2. The SNS and FCM broadcast topics are removed. The NativePush:Sns:BroadcastTopicArn and NativePush:Fcm:BroadcastTopic settings are gone, so neither is part of an adapter's completeness gate any more (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsNativePushSettings.cs:51-53, MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmNativePushSettings.cs:28-30), and a malformed topic name can no longer fail startup. The SNS registrar no longer subscribes an endpoint to a topic, and the identity's documented permissions drop the topic actions (MMCA.Common/Source/Hosting/MMCA.Common.Aws/AwsServiceCollectionExtensions.cs:148-154); the FCM registrar no longer subscribes or unsubscribes tokens, so a registration is the Firestore document alone. The CS0618 rationale in the Decision no longer leans on the topic APIs (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushMessage.cs:31-37). Deployments delete both keys; the topics can be deleted.
  3. The Notification Hubs sender attempts every chunk on both platforms. Before, the first failing send (an APNs rejection, say) ended the loop, skipping the remaining chunks and the FCM sends after it. SendToUsersAsync now sends FCM v1 and APNs for every 20-tag chunk through TrySendAsync, which logs and collects a failure instead of throwing (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:36-40, :55-66), and rethrows at the end, the single failure as itself through ExceptionDispatchInfo and several as an AggregateException (:42-50). SendPushNotificationHandler's non-fatal catch therefore still sees the failure and logs its warning. The catch filter excludes the caller's own cancellation (:61), which still stops the loop at once. A new Consequences entry records it.
  4. Anchors in the Decision refreshed: AddAmazonSnsPush at AwsServiceCollectionExtensions.cs:162, AddFirebaseCloudMessagingPush at GcpServiceCollectionExtensions.cs:137, the SNS stale-endpoint removal at SnsNativePushSender.cs:81-83, :97-102, and the FCM prune at FcmNativePushSender.cs:76. The Consequences anchors and those inside earlier revisions were not re-verified in this revision.

Revision (2026-11-07): per-platform outcome

On 2026-10-17 iOS delivery failed for every recipient and nobody in the app could tell: the only trace was a log Warning. MMCA.Common v1.280.0 makes the native leg report what it achieved, per platform, and shows it to the organizer who pressed Send (MMCA.Common/CHANGELOG.md:13, :21-23). User-targeted sends, the three adapters, the Null defaults, the best-effort leg and the SignalR-owned Status are unchanged.

  1. The interface returns an outcome (breaking). SendToUsersAsync returns Task<NativePushOutcome> and reports a failed send instead of throwing; only the caller's own cancellation propagates (MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/INativePushSender.cs:14-26). NativePushOutcome carries Android and Apple (NativePushPlatformCounts?, null when that platform was not attempted), the Unit, the FirstFailure, HasFailures, None and From(...) (.../Notifications/NativePushOutcome.cs:9-57); NativePushPlatformCounts is Sent, Failed and Attempted (.../Notifications/NativePushPlatformCounts.cs:9-13). NullNativePushSender returns None (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NullNativePushSender.cs:15-16). A custom sender changes its return type, and a Moq mock returns NativePushOutcome.None (MMCA.Common/UPGRADING.md:39-71).
  2. Units per provider (NativePushDeliveryUnit, .../Notifications/NativePushDeliveryUnit.cs:4-17):
    • Notification Hubs counts Batch, one per 20-user chunk per platform, Android for FCM v1 and Apple for APNs, because the hub reports per send only, never per device. The rethrow the previous revision added is gone: the counts and the first failure are returned (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:14-19, :40-66). An audience of 8 users therefore shows "1 of 1 batch".
    • SNS counts Endpoint, on the platform of the endpoint's platform application (fcmv1 Android, apns Apple); a disabled or missing endpoint counts as failed, which is how a bad APNs credential surfaces, and a failed user lookup is a failure with no platform count (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Notifications/SnsNativePushSender.cs:27-30, :56-71, :201-202).
    • FCM reports Message with the first failure and no per-platform counts. An FCM installation records platform fcmv1 on Android and iOS alike (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushDeviceRegistrar.cs:49), so a token does not say which phone it belongs to, and guessing would mislabel phones (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmNativePushSender.cs:21-23, :85-87).
  3. The handler records five columns and keeps the Warning. The native leg moved into SendNativeAsync, which records the outcome with PushNotification.RecordNativePushOutcome (MMCA.Common/Source/Core/MMCA.Common.Application/Notifications/PushNotifications/UseCases/Send/SendPushNotificationHandler.cs:153-177): AndroidSent, AndroidFailed, AppleSent, AppleFailed (nullable ints; null means not attempted, or a row written before this release) and NativeDeliveryUnit (the unit's name, at most 20 characters) (MMCA.Common/Source/Core/MMCA.Common.Domain/Notifications/PushNotifications/PushNotification.cs:25, :63-79, :185-191), mapped in the one engine-neutral configuration (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Configuration/EntityTypeConfiguration/Notifications/PushNotificationConfiguration.cs:58-63) and carried on PushNotificationDTO. An outcome with no counts and no failure (nothing attempted, or a fully successful FCM send) records nothing (SendPushNotificationHandler.cs:167-173), so a stored unit without counts always means a failure no platform could be named for. When FirstFailure is set the handler logs the same Warning, "Push notification {NotificationId} native (OS-level) delivery failed; inbox and SignalR legs unaffected", WITH that exception (:179-182, :236-237), and an exception from the sender itself still lands in the same catch (:185-189). The production native-push alert reads that exception row, so the message text and the exception both stay. SNS and FCM failures now raise the Warning too, where before neither sender threw.
  4. The Phone delivery column. NotificationList gains a "Phone delivery" column (MMCA.Common/Source/Presentation/MMCA.Common.UI/Pages/Notifications/NotificationList.razor:73, :95-112; SharedResource.resx:955-956): per platform counted, status first with the unit explicit, for example "Android: delivered (1 of 1 batch)" or "iPhone: partly failed (2 of 3 batches)", the unit word singular for a count of 1 (batch, device or message); "Phones: failed" when a failure was recorded without counts; "-" for a row with nothing recorded (NotificationList.razor.cs:67-110; SharedResource.resx:973-1001). The chip text carries the status, so color and icon are never the only cue. English and Spanish.
  5. Consequences. One migration on the Notification database of every host that maps PushNotification (five nullable columns, no default, no backfill; MMCA.Common/UPGRADING.md:73-81); among the first-party consumers only ADC maps it. Two live Consequences entries are corrected in place (the Notification Hubs failure handling no longer rethrows; the third leg now records per-platform counts), and the Decision anchors for SendToUsersAsync, the SNS stale-endpoint removal and the FCM prune are refreshed (INativePushSender.cs:26, SnsNativePushSender.cs:95-99 and :111, FcmNativePushSender.cs:70-73).
  6. Not done. A per-device delivery record (the hub does not return one, and the stored counts are per-platform totals), retrying a failed batch, and any change to the inbox or SignalR legs or to the overall Status.

Revision (2026-11-23)

Re-verified against current source. The decision is unchanged: three delivery adapters each gated on NativePush:Enabled and a complete section, the Null-by-default sender and registrar, account erasure removing a user's devices through DeleteAllForUserAsync on every registrar, the startup tripwire naming all three calls, one payload shape in the core, and the unregister leg running before the local sign-out in both LogoutAsync and RevokeAllSessionsAsync. Only anchors in the live sections moved.

  1. Anchors re-verified against current source:
    • IPushDeviceRegistrar is IPushDeviceRegistrar.cs:12, with UpsertAsync at :30, DeleteAsync at :49, DeleteAllForUserAsync at :66 and the idempotent, durable-retry remark at :62-64.
    • DeleteAllForUserAsync is AzureNotificationHubDeviceRegistrar.cs:122-143 (list at :127, the per-installation delete loop at :135-143), SnsPushDeviceRegistrar.cs:128-141 (remarks at :122-127) and FcmPushDeviceRegistrar.cs:102-120; the Null default stays at NullPushDeviceRegistrar.cs:25.
    • ADC's Identity service calls AddAzureNotificationHubsPush at MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:234, explained at :230-233.
    • AddAmazonSnsPush is AwsServiceCollectionExtensions.cs:174, its settings documentation :150-158, its runtime gate :180-182 and the table key and UserId-index documentation :161-163. AddFirebaseCloudMessagingPush is GcpServiceCollectionExtensions.cs:149, its settings documentation :130-132 and its runtime gate :155-157.
    • The native push tripwire check is CloudAdapterTripwire.cs:77-82, its message at :81, below the Passkeys (:64-69) and MachineClients (:71-75) checks.
    • The Notification Hubs sender calls the core payload builders at AzureNotificationHubNativePushSender.cs:32-33; FcmPushMessage maps them in Build at FcmPushMessage.cs:41-61.
    • The FCM registrar's APNs rejection is FcmPushDeviceRegistrar.cs:33-39 (:41-47 rejects any other non-fcmv1 platform).
    • The SNS ownership condition is applied at SnsInstallationRegistry.cs:92, the UserId lookup is :122-123, and QueryByUserAsync pages at :112-147 (LastEvaluatedKey at :140).
    • SNS sends: the per-endpoint publish loop is SnsNativePushSender.cs:65-72 (PublishAsync at :85-92), the stale-endpoint removal calls :116-120, and the log messages :128-141.
    • FCM sends: the lookup is called at FcmNativePushSender.cs:40 and chunked per 30 users at :94, Chunk(MaxMessagesPerSend) is :48 and SendEachAsync :54, and the log messages are :126-142.
    • The delete ownership check is AzureNotificationHubDeviceRegistrar.cs:90-98, with the unknown-id success at :101-105.
    • Client: the NullPushDeviceTokenProvider TryAdd is MMCA.Common.UI/Services/Capabilities/DependencyInjection.cs:67, AddMauiPushDeviceTokenProvider() is MMCA.Common.UI.Maui/DependencyInjection.cs:136-144 (FCM at :139, APNs at :141), the registration SemaphoreSlim and its WaitAsync are MauiPushRegistrationService.cs:26,43, and the unregister calls are AuthUIService.cs:103,159, each ahead of SignOutLocallyAsync at :116 and :160, with UnregisterPushAsync defined at :512. Anchors inside earlier revisions are left as recorded, including the 2026-10-24 registration and gate lines, the 2026-11-07 SharedResource.resx and UPGRADING.md lines, and the CHANGELOG lines.