Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Looks good. I ran the reproduction from #57092 under browser conditions. On the base, three unchanged syncs re-ran the session.list() effect 3 times, sorted the list 3 times, and replaced the session object. With this change there are no re-runs and no sorts, and the same object is kept. The new reactivity test fails on the base source and passes with the change. bun run test passes in both stages and bun run typecheck is clean in packages/client. CI runs each package's test script through turbo, so the new test:reactivity stage will run there.
Public API: unchanged; only the package's test scripts are new.
No blocking concerns. Writing each session with reconcile, as session.remember already does, still adds new sessions, removes omitted optional fields and leaves children in place. Heads-up: #56253 rewrites these same lines, so whichever lands second should keep the reconcile write.
Related: #55948
Issue for this PR
Closes #57092
Related #56253 (touches the same lines in
session.sync; whichever lands second needs a small rebase).Type of change
What does this PR do?
session.syncstored each fetched session withdraft[session.id] = session, so an unchanged session still got a new object. That re-sorted the session list and re-ran every consumer ofsession.list()on each sync. This switches to a per-entryreconcile(session), the patternsession.rememberalready uses. Unchanged data keeps its identity. Omitted optional fields are still removed, changed fields still notify,children: truestill never deletes children, andsession.deletedis untouched.The new reactivity test needs the browser build of solid-js, because the server build has no effects. It is skipped in the default stage, so
package.jsonnow runstest:unitand then a focusedtest:reactivitystage (one test, selected by name). Without that the test would never run in CI.architecture: existing
reconcileprecedent in the same store, no new infrastructure.How did you verify your code works?
In
packages/clientwith bun 1.4.2:bun run testpasses: 230 pass, 1 skip, 0 fail in the unit stage, then 1 pass, 0 skip in the reactivity stage.bun run typecheckis clean. Pre-pushbun run checkpassed.I did not measure how often real clients trigger an unchanged sync.
Screenshots / recordings
N/A, no UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #55948