mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
Two findings from the last codex round on #15742, which merged before these landed. Both are real; the third report was the same ref finding filed three times. The ref wrapper `OGDialogContent` gained there swallows a callback ref's return value. Under the React 19 peer range a consumer's teardown never runs when the node is replaced, stranding whatever it had attached — the direct forwarding it replaced had no such gap. The cleanup is passed on now, and only when it really is a function, because React 18 warns about any other return value. The Escape fallback also called the consumer's `onEscapeKeyDown` before establishing that this dialog was the one the Escape belonged to. Every mounted dialog runs that listener, so a dialog underneath fired its handler for someone else's keystroke — and a `preventDefault()` there would have stopped the frontmost dialog from closing at all, since the lower listener registers first. The call now happens after the frontmost check. The gating has a regression test, verified to fail without the fix. The ref cleanup does not: React 18 ignores the returned function outright, so the repo's own test runtime cannot observe it. `packages/client` 488 tests, typecheck and static checks clean. |
||
|---|---|---|
| .. | ||
| src | ||
| babel.config.js | ||
| jest.config.js | ||
| jest.resolver.cjs | ||
| jest.setup.ts | ||
| package.json | ||
| tailwind.config.js | ||
| tailwind.preset.cjs | ||
| tsconfig.json | ||
| tsconfig.test.json | ||
| tsdown.config.mjs | ||