Repository navigation
fix(web): bump @assistant-ui/react to ^0.14.22 — fixes session-view crash - #299
Merged
Merged
Conversation
…rash Clicking a session crashed the whole view with `TypeError: Cannot read properties of undefined (reading 'length')` (at React's areHookInputsEqual). Root cause: a Rules-of-Hooks violation inside assistant-ui's `useThreadViewportAutoScroll` → `useOnScrollToBottom` (`ThreadPrimitive.ViewportScrollable`) — hook #27 flips between useCallback and useEffect across renders, so React reads `.length` of an undefined deps array (cf. react/react#18372). Introduced by the dep bump in #248 (0.14.14 → 0.14.20); the regression window is 0.14.19–0.14.20, where assistant-ui added React Compiler precompilation (which emitted the conditional hook). Fixed upstream by 0.14.21+. Note: this only reproduces in a real browser — jsdom never performs the layout/scroll re-render that triggers the hook-order flip, so the existing vitest render test passes on the broken version (verified). A real regression guard needs browser-based testing (the planned web/e2e Playwright net). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Bug
Clicking into any session crashes the whole view (CatchBoundary) with:
Live on
main(and prod) right now — fires on session-click regardless of session data.Root cause
A Rules-of-Hooks violation inside
@assistant-ui/react: hook #27 inThreadPrimitive.ViewportScrollableflips betweenuseCallbackanduseEffectacross renders, so React'sareHookInputsEqualreads.lengthof an undefined deps array (same mechanism as react/react#18372).Introduced by the dependabot bump in #248 (
0.14.14 → 0.14.20). The regression window is0.14.19–0.14.20, where assistant-ui added React Compiler precompilation — which emitted the conditionally-present hook. Fixed upstream in0.14.21+.Fix
Bump
@assistant-ui/react^0.14.20 → ^0.14.22(latest; resolves to 0.14.22).tscclean, full web vitest suite 52/52 green, no API breakage.On a regression test
I dug into this — jsdom cannot catch this class of bug. The existing
SessionThread.test.tsxalready mounts the real<Thread/>/ViewportScrollable, yet it passes on the broken0.14.20(verified), because jsdom never performs the layout/scroll re-render that triggers the hook-order flip. A real regression guard requires browser-based testing (headless Chromium) — the right home is the plannedweb/e2ePlaywright net (ADR 0051 prep step), not new infra bolted on here. Flagging rather than standing that up in a hotfix.🤖 Generated with Claude Code