Skip to content

state: the JSON IR can't tell a declared zero-valued onError from none #251

Open

Description

@reka18

What happens

An Invocation always writes its onError key, holding the zero event when none was declared. So the IR can't tell an onError deliberately declared as the zero value, such as the first constant of an iota enum, from no onError at all. The builder knows the difference; a machine loaded from JSON doesn't. Any fix for the InvokeActor onError issue that reads "was an onError declared" needs this to survive the IR.

Options

  • write the onError key only when one was declared, and read a present key as declared; tried in fix(durable): don't journal a step whose context ended partway #234 and reverted, since it changes what an existing key means in the frozen wire form;
  • an additive field, such as "hasOnError": true, beside onError; older documents load as undeclared.

Relates to: #234

Activity

  1. reka18 commented on Nov 27, 2026

    @reka18
    ContributorAuthor

    #268's has-onError flags already let the JSON IR tell a declared zero-valued onError from none. fix/state-onerror-declared, a working branch with no PR yet, adds a test in state/invoke_flags_test.go that pins the round trip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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