Skip to content

Fix affects and answer merging on keyed guess sources; guide keeps early errors (#50, #51, #52) - #63

Open
ryansolid wants to merge 1 commit into
mainfrom
claude/project-thread-h5f2ue
Open

ryansolid wants to merge 1 commit into
mainfrom
claude/project-thread-h5f2ue

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

Fixes #50, fixes #51, fixes #52 (all reported by @revosw while porting an app).

#50: affects on a keyed or structured source that takes a guess. The accessor of such a source wraps its store (() => store). refresh already unwrapped it, but affects passed the wrapper straight to Solid, which threw INVALID_AFFECTS_TARGET in dev and did nothing in prod (AC-5). The fix unwraps the store in rt.ts, rt-web.ts and the oracle. The new scenario S-affects-keyed failed on main in the compiled runner and the oracle, and passes now.

#51: a keyed guess source replaced every row on each answer. The derive of createOptimisticStore assigned draft[i] = x. It now merges each answer by key (landDraft): a row whose key stays keeps its object and takes only the changed leaves. A direct check against Solid next shows a reader of row 0 ran 3 times over 3 answers before the change and runs once after. Two alternatives didn't work. Returning the answer from the derive, so Solid reconciles it, broke S-store-7 with Solid's internal error reading '_x'. reconcile(v, key)(draft) refuses an async derive's draft ("not a store proxy"). The unkeyed path still uses assignDraft.

#52: the guide's action example dropped an error thrown before the first await. Per EF-8, the onFlush clear runs after the action's first instant, so it erased a catch write from that instant. In guide/async.md §3 the catch now writes the error plainly, which lands with the revert, and also through onFlush, which runs after the clear in the same instant (call order). I checked this in the interpreter with a sync throw and an async reject: both end on the error, and the async case still shows the revert and the error in one frame. The guide also explains why, in one paragraph.

Tests (Solid next @ 2105ffb): interpreter 130 pass, compiled 130/0, oracle 130/0, types 176/0, ssr 122 pass / 7 skip (run before the rebase onto eb31e29).


Generated by Claude Code

…rly errors (#50, #51, #52)

- affects: a structured source's accessor wraps its store, so pass Solid the
  store, as refresh already did (rt, rt-web, oracle). New scenario
  S-affects-keyed.
- A keyed source that takes a guess merges each answer into its draft by key:
  a row whose key stays keeps its object and takes the new leaves, so its
  readers no longer re-run on every answer.
- guide/async.md §3: the catch also writes the error through onFlush, so a
  failure before the first await is not erased by the clear (EF-8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWP9oqnMKPnNUGcaK7a
@ryansolid ryansolid self-assigned this Nov 13, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
11fdb05 2026-11-13T19:52:13.109Z View logs ↗

This branch has not been deployed

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