Repository navigation
Import helpers called inside a spread; back off failing streams - #164
Merged
Merged
Conversation
The identifier guard `(?<![\w$.])` took any name after a `.` for a member's property, including the last dot of a spread's `...`: `[...pick(x)]` compiled to a call of `pick` with no import of it. One shared guard, NAME_START, now refuses only a member's `.` (and `?.`); it replaces the same pattern in namesIn (the page module's and the early script's imports), the built-in formatter checks, the impure-helper check of row programs, `reads` and the early `$k` guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjKzdxiisqN9crUQ7XSyca
A 2xx probe opened the stream at once and only wait() grew the backoff, so a stream endpoint that failed while the session probe succeeded looped probe + connect as fast as round trips allowed; and since every open reset the backoff, a server that accepted and closed at once looped every second (at once, with the probe). Now a drop reconnects at once only when the connection had opened and no other quick reconnect happened in the last 10 s; anything else waits its backoff (then probes), and the backoff resets only once a connection has stayed open 10 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjKzdxiisqN9crUQ7XSyca
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.
Two fixes from a stability review.
A helper called only inside a spread is imported
The compiler's "is this name used" pattern,
(?<[\w$.])name, skipped any name after a.. That includes the last dot of a spread's..., sodata-sn-text="[...pick(n)].length"compiled to a call ofpickwith noimport { pick }, and the binding failed in the browser.One shared guard,
NAME_STARTinsrc/compiler/code-text.ts, now refuses only a member's.and?.. It replaces the same pattern in:namesIn, which decides the page module's and the early script's importsearly-parts.tsprerender.tsreadsinexpr-queries.ts$kguard inindex.tstest/compiler/helper-spread.test.tscovers array spread, object spread and a namespace member, and checks that an unused helper still isn't imported. Three of its four tests fail onmain. It also passes underSN_LINK_AUDITandSN_FROM_WALK_AUDIT.Streams back off instead of reconnecting in a loop
src/sse.tshad two loops:wait()grew the backoff. A stream endpoint that kept failing while the probe succeeded (a proxy answering 502) looped probe and connect as fast as round trips allowed.Now:
A working connection that drops still reconnects at once, as before, and the existing stream tests pass unchanged. Three new tests in
test/behaviour/sync.test.tscover a stream failing while the probe succeeds, a server that accepts and closes at once (with and without the probe), and the reset after a stable connection. All three fail onmain.docs/sync.md(connection rules) andCHANGELOG.mdare updated.Checks
npm run typecheckpasses.npm test: 360 files, 3,607 tests pass, 1 skipped.Generated by Claude Code