Repository navigation
Register ChatKit event listeners before applying options - #214
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
This branch has not been deployed
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.
Problem
The React wrapper calls
setOptionsin a layout effect, but registers event listeners in a later passive effect. Synchronous events from initial configuration are missed. On reconfiguration, they can reach the previous handlers instead of the current ones.Change
Register listeners in a layout effect before applying options. Retain AbortController cleanup and the existing late-definition cancellation path. Add a patch changeset and development-only DOM test dependencies.
Validation
CI=1 pnpm checkpassed formatting, lint, type checks, documentation build, and tests in an isolated temporary checkout. Changed files were byte-checked against the publication checkout.git diff --checkpasses.Node 26.8.1, React 19.1.1, Happy DOM 20.14.5 on macOS arm64. Tests use the production wrapper and a synthetic custom element that emits events from
setOptions. The hosted ChatKit component and live API were not exercised. Runtime dependencies and public interfaces are unchanged.Reproduced against
22613848a656077a408788f028c7727e38d10449.