Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Broadcast audits a half-failed send as a success #6

Description

@Taure

asobi_admin_notifications_controller:broadcast/1 calls
asobi_admin_ui_audit:log_action(~"broadcast", #{recipient_count => length(SentTo)}, {ok, SentTo}).

The {ok, SentTo} is constructed by the handler, not returned by the
operation. asobi_admin_notifications:do_broadcast/4 drops every failed
insert on the floor and returns only the survivors, so a broadcast to ten
players that reached three is logged as outcome => ok with
recipient_count => 3. Nothing anywhere records that seven failed.

What core now provides

asobi core ships the durable audit and the widened contract (plan item 2a.8):

  • asobi_notify:send_many/4 returns {ok, Succeeded, Failed}.
  • asobi_ops_notifications:broadcast/5 takes an actor, fans out, and writes
    an ops_audit_entries row through asobi_ops_audit:mutation/4. It cannot
    misreport, because the row is built from the operation's own return value.
  • The row carries actor_id, actor_display, actor_source and
    actor_attested, plus outcome (ok / partial / error) and the two
    counts.

Work here

  1. Delete asobi_admin_notifications:do_broadcast/4 - it is a copy of
    asobi_notify:send_many/4 and now a stale one.
  2. Have the UI controller and asobi_admin_notifications:broadcast/1 call
    asobi_ops_notifications:broadcast/5, passing the session's actor.
  3. Drop the hand-built {ok, SentTo} audit call at the broadcast site.
  4. Decide what the UI shows on a partial send. The current redirect carries
    only ?sent=N, which reads as a success.

asobi_admin has no actor record yet; it still pins one hardcoded principal.
Constructing an #{id, display, source, caps, attested} for the session is
part of this, or a prerequisite issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions