PhoenixKitProjects.Activity (PhoenixKitProjects v0.12.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)

@spec actor_uuid(Phoenix.LiveView.Socket.t()) :: binary() | nil

Extracts user.uuid from the LiveView socket assigns.

log(action, opts)

@spec log(
  binary(),
  keyword()
) :: term()

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

log_failed(action, opts)

@spec log_failed(
  binary(),
  keyword()
) :: term()

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.