Osy#betaRun it on Osyrin: osyrin.com

Reference / Project

Sending a Failed event again (operator)

osyrin app events failed --app <slug> · osyrin app events redeliver <id> --app <slug>

An event that was accepted with OK, whose [On] handler then failed all its tries, ends Failed in the app's outbox. An app Owner or Admin lists those events and sends one again from the CLI — to exactly the handlers that failed it, once, audited.

stableprojectoperationsevents

Summary#

Raise answers OK once the event is accepted; its [On] handlers run after that, and a handler that throws on all its tries leaves the event Failed ([[function-on#failure]]). Inside the app, gated code can send it again with Events.Redeliver(id). From outside, an operator uses two verbs.

Signature#

$ osyrin app events failed --app <slug>              # list: id, event type, handler, failed at, last error
$ osyrin app events redeliver <id> --app <slug>      # send one Failed event again

Description#

Listing#

One row per Failed event: its id, the event type, the handler(s) still owed it, when it was given up on and the last error (the handler's exception type and message, redacted as the app's log is). Never a value of the event — read the record it was about in the app if you need it. --json prints the same rows.

Redelivering#

redeliver <id> resets that one event to waiting, with every try ahead of it, and delivers it now through the platform's own outbox code:

  • Only a Failed event. A delivered or still-waiting event, an unknown id, or one another operator redelivered a moment earlier is refused by name.
  • Exactly the handler it was owed to. A handler that already succeeded on that event is not run again, so there is no second fan-out.
  • Who: the application's Owner or Admin (or an owner or admin of its organization, or a platform operator), enforced on the server. A Developer is refused. On an application a zone serves, Admin signs an events grant for it, and a redeliver's grant names the one event.
  • Audited: an EventRedelivered line on the app's sign-in trail (AuthAuditEntry) names the operator, the event id and the handler.

A handler may run more than once over an event's life, so write it so a second run does no harm ([[function-on#failure]]). The verb is the one redeliver path from outside the app; there is no REST or SQL way around it.

See also#

Related

[On] — hear an event, after the commit that raised it

`[On]` on a function makes it a HANDLER of the event its one parameter is. Every handler of an event — in the app and…

[Event] — what happens to a record, declared once

An event is a class marked `[Event]`: something that happens to a record, declared once by the code that owns the…

Stopping runs after a bad deploy

A workflow run keeps executing the version it started under, which is exactly what you want until that version is the…

Reading a run — from app code and from a test

App code and tests read a workflow run THROUGH THE ROW IT TRACKS: `<Wf>.For(item).Flow` (did it start, has it…