Repository navigation
fix(cloudflare/workers): converge plans with Effect-valued env bindings - #890
Merged
Merged
Conversation
An Effect-valued Worker tag in `env` (the circular-bindings pattern) re-planned as `update` on every deploy, forever (#874): - `havePropsChanged` now compares both sides through `stripUnresolved`, matching the commit boundary — a tag's `toJSON` form no longer reports a phantom change against the stripped stored props. - The Worker providers' `diff` strips Effect-valued entries before the `isResolved` gate so bundle/metadata hash change detection still runs (a code-only edit must still plan an update). - Terminal apply commits persist the RESOLVED binding payload the provider reconciled with instead of raw `node.bindings`, so the next plan's `diffBindings` compares like against like. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/b2e8e5a@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/b2e8e5a@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/b2e8e5a |
…lans Co-Authored-By: Claude Fable 5 <[email protected]>
Regression for the second path reported in #874 (the PR #266 case): plain_text binding whose text is an Output must plan noop after apply. Co-Authored-By: Claude Fable 5 <[email protected]>
Guards the binding-data change-detection channel that #874's Effect stripping relies on: v1 -> noop, v2 -> update -> deploys -> noop. Co-Authored-By: Claude Fable 5 <[email protected]>
Unit regression for the Apply.ts half of #874 across the create, update, and replace commit sites: persisted binding data must be the resolved value, not a live Output expression. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Binding a tagged Worker identity in another Worker's
env(the circular-bindings pattern) deployed correctly but re-planned asupdateon every subsequent plan, forever.The tag is an Effect:
stripUnresolveddrops it from stored props at commit, while the desired props still carry it — and itstoJSONserializes to{"_id":"Effect",...}, so the engine's raw-props fallback saw a permanent diff.Three changes, each covered by the new regression test:
havePropsChangedcompares both sides throughstripUnresolved, symmetric with the commit boundary, so an Effect in desired props no longer reports a phantom change.WorkerProvider.diff(and the local dev provider) strip Effect-valued entries before theisResolvedgate instead of bailing to the raw-props fallback — bundle/metadata hash change detection still runs, so a code-only edit tomainstill plans anupdate(verified: reverting just this piece makes the code-change assertion fail with a silent noop).bindingOutputsthe provider reconciled with instead of rawnode.bindings(which hold unresolved Outputs that JSON state stores silently drop), so the next plan'sdiffBindingscompares like against like. This is the second non-convergence path reported in the issue comments (the PR fix(core): persist resolved bindings on terminal commits #266 case).The regression test deploys a target + a caller bound via the Effect tag in
env, asserts the live service binding, asserts an identical program plansnoopfor both workers, then edits the caller's entry file and asserts the plan flips toupdate.Closes #874
🤖 Generated with Claude Code