Repository navigation
Conversation
Extract the repeated `(globalThis as { window?: unknown }).window !==
undefined` expression into a single `shared/is-browser.ts` helper and
point the three existing SSR guards at it, so the next adapter reaches
for one canonical check instead of a byte-similar inline copy.
Vue's useQuery/subscribeToQuery/use-paginated-core and Svelte's agent()/ rateLimit() open live subscriptions (and, for rateLimit, a setInterval) eagerly with no browser check. A component's setup/init can run inside renderToString with no window and no unmount hook, so each server render leaked a subscription (or a timer) for the life of the process. Guard each subscription-opening/timer-arming call with the shared isBrowser() helper, mirroring the existing use-presence.ts/agent-chat.ts pattern: browser behaviour is unchanged, SSR leaves refs/stores at their inert initial values with a callable no-op teardown. Composables built on the guarded primitives (useAgent, useAgentChat, useAgentState, useAgentToolEvents) inherit the fix transitively; their test suites now stub `window` per test (vitest's env is `node`, so none is present by default) to keep asserting real browser behaviour, with a dedicated SSR test added per guarded primitive to prove the guard. Solid (createEffect/onMount) and Angular (shouldOpenSubscription/ PLATFORM_ID) are untouched — already SSR-safe by construction.
Both adapters built their per-page subscription key with raw JSON.stringify, unlike Vue/Solid/the client SDK's SubscriptionRegistry, which already converged on stableWireKey. A wire-typed page arg (bigint, Date, bytes) throws instead of tokenizing deterministically, and a page-key computed from an unsorted arg record can drift from the canonical form used everywhere else. Both engines hold their base args as a fixed reference for the whole instance lifetime, so a within-engine key-order drift is not reachable today; the duplicate-subscription/result-carry-miss risk described in the audit lives at the client SDK's dedup layer (already correct), not in this adapter's own bookkeeping — recorded in the new tests' comments rather than asserted, since there is no reachable pre/post-fix difference to demonstrate for that scenario. The wire-typed-arg case is directly demonstrable and covered.
`upload()` documents `start` as "start (or restart)" but never reset its signals: a retry after a failed upload rendered status "uploading" alongside the previous failure's `error`, and a subsequent success left `error` stale next to `status: "success"`. `pause()`/`resume()` were also unconditional, so calling either outside an in-flight upload stamped "paused"/"uploading" over a terminal state. `start` now clears `error`/`result`/`progress`/`isPaused` and stamps `status: "uploading"` synchronously before delegating to the adapter. `pause()`/`resume()` are no-ops unless the handle is actually `"uploading"`/`"paused"`. Updated the one existing test that paused from `"idle"` (which encoded the bug) to drive the adapter's start callback first.
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (13)
📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
❌ Deploy Preview for lunorash failed.
|
|
Thank you for following the naming conventions! 🙏 |
|
Thank you for confirming the Contributor License Agreement! 🙏 |
|
Closing: this PR was opened in error by an automated run, outside the scope of its task. No work is lost — the branch is retained on origin and this PR can be reopened at any time. Context: this branch predates the merges of #288 and #289, so much of its content is already on |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Work from an agent worktree, pushed under a descriptive name (local branch was
worktree-agent-a5593d536c42bc6b6).Branched before #288/#289 landed, so it needs a rebase onto current alpha before merge.
Commits