Skip to content

Retire schema-generated computed resolvers when an expression is removed #3782

Open

Description

@kriszyp

Removing a schema-defined computed expression can leave the previous function in Table.userResolvers. Redeclaring the same field as a bare computed field then continues returning the old expression's result.

Computed reads prefer the resolver registry. Schema-compiled expressions and imperative setComputedAttribute() registrations share that registry, so retirement needs ownership information rather than clearing every entry.

Reproduced with real modules on development head 01f458e: register fullName with computed: {} and computedFromExpression: "first + ' ' + last", store a synthetic record, then redeclare fullName with computed: {} and no expression. Both reads return Ursula Le Guin, and userResolvers.fullName remains a function. The same registry behavior is present on the linked main source; no released-version boundary was investigated.

Retire a prior schema-generated resolver when its expression/field is removed or replaced. Preserve an explicitly registered application resolver and same-class reload behavior. Add RocksDB/LMDB regressions for expression-to-bare-computed, removal/re-addition and imperative overrides.

This pre-existing lifecycle gap is separate from #3594's generated accessor retirement and live-binding safety repair.

Review-Deferral: 8dece860c91d5dcb severity=minor category=correctness

🤖 Generated by OpenAI Codex; posted via @kriszyp.

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

    Fields

    Priority

    P2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions