PhoenixKitProjects.Activity (PhoenixKitProjects v0.5.0)

Copy Markdown View Source

Activity logging wrapper for the Projects module.

Summary

Functions

Extracts user.uuid from the LiveView socket assigns.

Logs a projects activity entry via PhoenixKit.Activity. Swallows errors so it never crashes the caller.

Logs a user-driven mutation that did NOT land cleanly — the success path would have called log/2 with the same action + opts; this variant tags the metadata with db_pending: true so audit-feed readers can distinguish attempted-but-failed actions from completed ones. Per the post-Apr 2026 pipeline standard (publishing-Batch-3 / catalogue-Batch-4 precedent): a Drive/DB outage must NOT erase admin clicks from the activity feed.

Functions

actor_uuid(socket)

Extracts user.uuid from the LiveView socket assigns.

log(action, opts)

Logs a projects activity entry via PhoenixKit.Activity. Swallows errors so it never crashes the caller.

log_failed(action, opts)

Logs a user-driven mutation that did NOT land cleanly — the success path would have called log/2 with the same action + opts; this variant tags the metadata with db_pending: true so audit-feed readers can distinguish attempted-but-failed actions from completed ones. Per the post-Apr 2026 pipeline standard (publishing-Batch-3 / catalogue-Batch-4 precedent): a Drive/DB outage must NOT erase admin clicks from the activity feed.

Identical signature to log/2. Same rescue/catch shape.