Skip to content

Pending-approval notification reaches the completer (instance-wide persistent), not the parent #508

@tempus2016

Description

@tempus2016

Problem

When a chore is completed and needs approval, the completer sees the "… awaiting approval" notification and the parent does not — the reverse of what should happen.

Two causes:

  1. Leak: NotificationCoordinator.fire() called persistent_notification.create unconditionally for every notification, ignoring audience and routing. persistent_notification is instance-wide (every HA user sees it in the bell), so a parent-audience message surfaced to whoever was viewing HA — typically the child on a kiosk who just completed the chore. (coord_notifications.py)
  2. Gap: the default route seeding only wires a parent in if a legacy notify_service existed at migration. A parent recipient added later (via the panel) is left with empty routes for pending_chore_approval / pending_reward_claim, so no parent is notified. Verified on ha-dev: pending_chore_approval had routes: {} while a "John" parent recipient existed.

Fix

  • Remove the unconditional persistent notification from fire(). A persistent notification now happens only when a recipient is explicitly routed to notify.persistent_notification, via the normal _send_to path. (send_test keeps its persistent confirmation.)
  • Add ensure_parent_default_routes(): subscribes enabled parents to default-on parent-audience types whose routes are still empty (never overrides explicit/cleared routing). Called on parent upsert and once at coordinator init (fixes existing installs).

Note for true per-person delivery: notify.persistent_notification is itself instance-wide; to have only the parent notified, the parent recipient should use a per-person channel (e.g. notify.mobile_app_johns_iphone).

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendIntegration / coordinator / config flowbugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions