Automations and webhooks for the AT Protocol airglow.run
automation webhook atproto atprotocol

refactor(logs): serialize delivery-log rows for the islands in one place #85

Open there-hugo.dev
Open opened by there-hugo.dev

Depends on #64 and #65.

Optional, low priority.

Problem #

Four places build the JSON a delivery-log island reads, each by hand. #56 was one of them missing runState.

Evidence #

  • The four hand-built row maps:
    • app/routes/api/automations/[rkey].ts:71-87
    • app/routes/api/automations/[rkey]/logs.ts:23-39
    • app/routes/u/[handle]/[rkey]/logs.tsx:108-121
    • lib/actions/logs-query.ts:43-66 (serializeLogRow, which also omits recordUri)
  • 1908205 added the missing field to only one of them.

Expected #

One helper in lib/actions/logs-query.ts builds the per-automation row shape (id, actionIndex, stepId, runId, itemIndex, eventTimeUs, statusCode, message, error, recordUri, dryRun, attempt, runState, createdAt). serializeLogRow extends it with the automation name and rkey. All four sites use it.

Acceptance criteria #

Out of scope #

Rendering recordUri in LogsBrowser or AdminLogsBrowser.

Sign up or Sign in to add to the discussion.