Skip to content

fix(json-logic): ensure custom operators are always available#260

Merged
eshiota merged 1 commit into
mainfrom
eshiota/fix-custom-json-logic-operators-lifecycle
Jun 18, 2026
Merged

fix(json-logic): ensure custom operators are always available#260
eshiota merged 1 commit into
mainfrom
eshiota/fix-custom-json-logic-operators-lifecycle

Conversation

@eshiota

@eshiota eshiota commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

This simplifies the lifecycle of JSON Logic custom operators, ensuring they are always registered at the beginning of each createHeadlessForm call and de-registered at its end (in addition to always doing it on every handleValidation call.

The previous logic did it every time applyComputedAttrsToSchema was called. However, we have other places where operators were needed but not available (such as when processing conditions that depend on JSON Logic).

Registering and de-registering operators on every createHeadlessForm and handleValidation call is necessary because JSON Logic maintains a single registry of operators shared across all headless forms. Handling this lifecyle in runtime guarantees each headless form instance has its own set of operators without side effects.

@eshiota eshiota requested review from antoniocapelo, danielcardoso5, sandrina-p and thiamsantos and removed request for antoniocapelo June 18, 2026 16:23
@eshiota eshiota merged commit 989bd10 into main Jun 18, 2026
5 checks passed
@eshiota eshiota deleted the eshiota/fix-custom-json-logic-operators-lifecycle branch June 18, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants