Skip to main content

Module notify

Module notify 

Source
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:

  1. settings.notifications.os_enabled == true
  2. transfer.state is Done or Failed (not Canceled — user-initiated cancellations are silent at the OS level).
  3. The OsNotifier::maybe_send internal gates also pass (non-Info severity
    • terminal = true).

§OCP

  • notify_terminal is generic over any EventEmitter and any OsNotifyChannel, 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 🔒