Expand description
Terminal-state notification helper for transfers.
§Single notification surface
notify_terminal is the only place in the codebase that pushes an
in-app notification and conditionally fires an OS notification for a
transfer that has reached a terminal state.
Adding new notification rules (e.g. “errors only”, “grouped by bucket”) is one branch here — no other call site changes.
§Gating (round-1 finding #4)
OS notifications fire only when:
settings.notifications.os_enabled == truetransfer.stateisDoneorFailed(notCanceled— user-initiated cancellations are silent at the OS level).- The
OsNotifier::maybe_sendinternal gates also pass (non-Info severityterminal = true).
§OCP
notify_terminalis generic over anyEventEmitterand anyOsNotifyChannel, so it works identically in tests and production.
Functions§
- build_
resource_ 🔒uri - Build the user-facing S3 resource URI shown in notifications.
- notification_
content 🔒 - notify_
terminal - Push an in-app notification for a terminal-state transfer, and optionally fire an OS notification based on the current settings.
- transfer_
operation 🔒