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 aNativePushOutcome;MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/INativePushSender.cs:12,:26) andIPushDeviceRegistrar(installation upsert/delete,MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/IPushDeviceRegistrar.cs:12,UpsertAsyncat:30,DeleteAsyncat:49, andDeleteAllForUserAsyncat:66, which removes every installation one user holds).AddInfrastructureTryAdds no-op defaults. - Account erasure removes the user's devices.
DeleteUserHandlerBasetakes an optionalIInternalCommandScheduler(MMCA.Common/Source/Core/MMCA.Common.Application/Users/UseCases/DeleteUser/DeleteUserHandlerBase.cs:103) and, when one is supplied, schedulesDeleteUserPushInstallationsInternalCommandin the erasure's unit of work (:195-198; the command atDeleteUserPushInstallationsInternalCommand.cs:18). Its handler callsDeleteAllForUserAsync(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 theUserIdindex (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 registersAddAzureNotificationHubsPushso the registrar reaches the hub devices register in (MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:230-234), and itsDeleteUserHandlerforwards 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:Enabledis 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 onConnectionStringandHubName. 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 onNativePush:SnscarryingInstallationsTableand at least one ofFcmPlatformApplicationArn/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 keyInstallationId, global secondary indexUserId-indexonUserId(: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 onNativePush:FcmcarryingProjectIdandInstallationsCollection(: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 withPushDevice.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+ deprecatesMessage.Tokenin 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.
- Azure Notification Hubs,
- A lost adapter call fails startup.
NativePush:Enabled=truewhileINativePushSenderis 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 theirUserIdfield instead (SnsInstallationRegistry.cs:122-123; Firestore queries at most 30 users at a time,FirestoreInstallationRegistry.cs:23). - One payload shape in the core.
NativePushPayloads.BuildFcmV1PayloadandBuildApnsPayloadare public inMMCA.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 typedMessageinstead of raw JSON (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmPushMessage.cs:7-9,:41-61), with a test pinning the equivalence. SendPushNotificationHandlergains the third leg. After the inbox write and the SignalR attempt, it callsINativePushSender.SendToUsersAsyncinside 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 inMMCA.Common.APIvia the existingAddNotificationControllersapplication part,[Authorize]for any signed-in user and feature-gated with the sameNotification.PushNotificationsflag 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 failsDeviceInstallationId.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 400PushDevice.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) andIPushDeviceTokenProvider(the platform token extension point). UI.Maui shipsMauiPushRegistrationService(stable installation id inIDevicePreferences, sync over the named API client, with aSemaphoreSlimserializing 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).UnregisterAsyncwaits 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 toNullPushDeviceTokenProvider(TryAdd,MMCA.Common.UI/Services/Capabilities/DependencyInjection.cs:68); the opt-inAddMauiPushDeviceTokenProvider()(MMCA.Common.UI.Maui/DependencyInjection.cs:163-171) replaces it withFcmPushDeviceTokenProvideron Android (gated on thePush:Fcmsection,FcmPushDeviceTokenProvider.cs:33,:99) andApnsPushDeviceTokenProvideron iOS/MacCatalyst (gated onPush: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 AndroidMauiFirebaseMessagingService.OnNewTokenre-registers when FCM rotates the token (MauiFirebaseMessagingService.cs:26-35).AuthUIServiceowns the unregister leg:LogoutAsyncandRevokeAllSessionsAsyncboth callUnregisterPushAsyncbefore 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) * 2hub 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 untilLastEvaluatedKeyis empty,SnsInstallationRegistry.cs:112-147,LastEvaluatedKeyat:140) plus one publish per distinct endpoint (SnsNativePushSender.cs:65-72,PublishAsyncat: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 oneSendEachAsyncper 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. BecauseSendPushNotificationCommandisITransactional, 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}tagUpsertAsyncstamped 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.
SendPushNotificationHandlergained 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
DevicesControllernow names the DELETE route correctly: PUT is the bare/Notifications/Devicesroute and DELETE is/Notifications/Devices/{installationId}(DevicesController.cs:22,31,55). - Anchors in the live sections were re-verified against current source:
AddMauiPushDeviceTokenProvider()is nowMMCA.Common.UI.Maui/DependencyInjection.cs:124-132, the unregister calls areAuthUIService.cs:90,143(definition at:342), and the handler's native leg and at-least-once remarks areSendPushNotificationHandler.cs:141-154and: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.
- Anchors re-verified against current source: the unregister calls stay at
AuthUIService.cs:90,143(each ahead ofSignOutLocallyAsyncat:101and:144), andUnregisterPushAsyncis now defined atAuthUIService.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.
- Anchors re-verified against current source:
DevicesControllerroutes are nowDevicesController.cs:22,35,60([Route]at:22,[HttpPut]at:35,[HttpDelete("{installationId}")]at:60); the registrationSemaphoreSlimand itsWaitAsyncareMauiPushRegistrationService.cs:27,44; and the delete ownership check (read the installation, check theuser:{id}tag, then delete) isAzureNotificationHubDeviceRegistrar.cs:84-92, with the unknown-id success path at:95-99.AddMauiPushDeviceTokenProvider()stays atMMCA.Common.UI.Maui/DependencyInjection.cs:124-132, the unregister calls atAuthUIService.cs:90,143(defined at:361), and the handler's native leg and at-least-once remarks atSendPushNotificationHandler.cs:141-154and: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.
- Registration renamed.
AddNativePushNotifications(configuration)is nowAddAzureNotificationHubsPush(configuration)(MMCA.Common/Source/Hosting/MMCA.Common.Azure/AzureServiceCollectionExtensions.cs:83), with the same gate onEnabled,ConnectionStringandHubName(:91-:96) before it registers the sender and registrar (:101-:102). - Types moved.
AzureNotificationHubNativePushSender(MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/AzureNotificationHubNativePushSender.cs:14) andAzureNotificationHubDeviceRegistrar(Notifications/AzureNotificationHubDeviceRegistrar.cs:15) live inMMCA.Common.Azure.Notifications, andNativePushSettingsis nowAzureNotificationHubSettings(Notifications/AzureNotificationHubSettings.cs:9). TheNativePushsection and its keys are unchanged (MMCA.Common/CHANGELOG.md:25). - A lost call fails startup.
NativePush:Enabled=truewhileINativePushSenderis still the Null sender failsValidateOnStart, naming the call (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:33,:48-:53). - 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.
- SNS mobile push (
AddAmazonSnsPush, MMCA.Common.Aws) over a DynamoDB installation registry with theUserId-indexglobal secondary index, the ownership and handover rule as one conditional write, a broadcast topic, and disabled-endpoint pruning on send (anchors in the Decision). - 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. - Payload builders moved into the core.
NativePushPayloads.BuildFcmV1PayloadandBuildApnsPayloadare public inMMCA.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 asNativePushUserTags(MMCA.Common/Source/Hosting/MMCA.Common.Azure/Notifications/NativePushUserTags.cs:8); the Decision bullet that credited it toNativePushPayloadsis corrected in place. - The startup tripwire names all three calls
(
MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Configuration/CloudAdapterTripwire.cs:53,MMCA.Common/CHANGELOG.md:33). - 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. - 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). - 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.
- 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.BroadcastTopicArnat:162); the single broadcast publish isNotifications/SnsNativePushSender.cs:73-80insideBroadcastAsync(:71); the disabled or missing endpoint pruning isSnsNativePushSender.cs:99-102; andNativePushPayloads,BuildFcmV1PayloadandBuildApnsPayloadareMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NativePushPayloads.cs:13,20,42. TheAddMauiPushDeviceTokenProvider()anchor inside the 2026-10-01 revision is left as recorded; the live Decision already citesMMCA.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.
- Send cost scoped per adapter. The Consequences entry on
ceil(N/20) * 2calls 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, becauseQueryByUserAsyncpages untilLastEvaluatedKeyis 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 oneSendEachAsyncper 500 distinct tokens (MMCA.Common/Source/Hosting/MMCA.Common.Gcp/Notifications/FcmNativePushSender.cs:39,43,57,63,FirestoreInstallationRegistry.cs:23,76,IFcmMessagingClient.cs:17). - 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). - 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(tryat:140,SendToUsersAsyncat: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 rangeSendPushNotificationHandler.cs:141-154in 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.
BroadcastAsyncis removed.INativePushSendernow declaresSendToUsersAsyncalone (MMCA.Common/Source/Core/MMCA.Common.Application/Interfaces/Infrastructure/Notifications/INativePushSender.cs:12,:21), and the method is gone fromNullNativePushSender, 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 itsBroadcastAsync; a caller has no replacement.- The SNS and FCM broadcast topics are removed. The
NativePush:Sns:BroadcastTopicArnandNativePush:Fcm:BroadcastTopicsettings 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. - 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.
SendToUsersAsyncnow sends FCM v1 and APNs for every 20-tag chunk throughTrySendAsync, 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 throughExceptionDispatchInfoand several as anAggregateException(: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. - Anchors in the Decision refreshed:
AddAmazonSnsPushatAwsServiceCollectionExtensions.cs:162,AddFirebaseCloudMessagingPushatGcpServiceCollectionExtensions.cs:137, the SNS stale-endpoint removal atSnsNativePushSender.cs:81-83,:97-102, and the FCM prune atFcmNativePushSender.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.
- The interface returns an outcome (breaking).
SendToUsersAsyncreturnsTask<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).NativePushOutcomecarriesAndroidandApple(NativePushPlatformCounts?, null when that platform was not attempted), theUnit, theFirstFailure,HasFailures,NoneandFrom(...)(.../Notifications/NativePushOutcome.cs:9-57);NativePushPlatformCountsisSent,FailedandAttempted(.../Notifications/NativePushPlatformCounts.cs:9-13).NullNativePushSenderreturnsNone(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Notifications/Push/NullNativePushSender.cs:15-16). A custom sender changes its return type, and a Moq mock returnsNativePushOutcome.None(MMCA.Common/UPGRADING.md:39-71). - 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 (fcmv1Android,apnsApple); 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
Messagewith the first failure and no per-platform counts. An FCM installation records platformfcmv1on 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).
- Notification Hubs counts
- The handler records five columns and keeps the Warning. The native leg moved into
SendNativeAsync, which records the outcome withPushNotification.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) andNativeDeliveryUnit(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 onPushNotificationDTO. 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. WhenFirstFailureis 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. - The Phone delivery column.
NotificationListgains 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. - 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 forSendToUsersAsync, the SNS stale-endpoint removal and the FCM prune are refreshed (INativePushSender.cs:26,SnsNativePushSender.cs:95-99and:111,FcmNativePushSender.cs:70-73). - 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.
- Anchors re-verified against current source:
IPushDeviceRegistrarisIPushDeviceRegistrar.cs:12, withUpsertAsyncat:30,DeleteAsyncat:49,DeleteAllForUserAsyncat:66and the idempotent, durable-retry remark at:62-64.DeleteAllForUserAsyncisAzureNotificationHubDeviceRegistrar.cs:122-143(list at:127, the per-installation delete loop at:135-143),SnsPushDeviceRegistrar.cs:128-141(remarks at:122-127) andFcmPushDeviceRegistrar.cs:102-120; the Null default stays atNullPushDeviceRegistrar.cs:25.- ADC's Identity service calls
AddAzureNotificationHubsPushatMMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:234, explained at:230-233. AddAmazonSnsPushisAwsServiceCollectionExtensions.cs:174, its settings documentation:150-158, its runtime gate:180-182and the table key andUserId-indexdocumentation:161-163.AddFirebaseCloudMessagingPushisGcpServiceCollectionExtensions.cs:149, its settings documentation:130-132and 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;FcmPushMessagemaps them inBuildatFcmPushMessage.cs:41-61. - The FCM registrar's APNs rejection is
FcmPushDeviceRegistrar.cs:33-39(:41-47rejects any other non-fcmv1platform). - The SNS ownership condition is applied at
SnsInstallationRegistry.cs:92, theUserIdlookup is:122-123, andQueryByUserAsyncpages at:112-147(LastEvaluatedKeyat:140). - SNS sends: the per-endpoint publish loop is
SnsNativePushSender.cs:65-72(PublishAsyncat:85-92), the stale-endpoint removal calls:116-120, and the log messages:128-141. - FCM sends: the lookup is called at
FcmNativePushSender.cs:40and chunked per 30 users at:94,Chunk(MaxMessagesPerSend)is:48andSendEachAsync: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
NullPushDeviceTokenProviderTryAdd isMMCA.Common.UI/Services/Capabilities/DependencyInjection.cs:67,AddMauiPushDeviceTokenProvider()isMMCA.Common.UI.Maui/DependencyInjection.cs:136-144(FCM at:139, APNs at:141), the registrationSemaphoreSlimand itsWaitAsyncareMauiPushRegistrationService.cs:26,43, and the unregister calls areAuthUIService.cs:103,159, each ahead ofSignOutLocallyAsyncat:116and:160, withUnregisterPushAsyncdefined at:512. Anchors inside earlier revisions are left as recorded, including the 2026-10-24 registration and gate lines, the 2026-11-07SharedResource.resxandUPGRADING.mdlines, and the CHANGELOG lines.