mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-19 14:33:38 +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. |
||
|---|---|---|
| .. | ||
| common | ||
| components | ||
| hooks | ||
| icons/provider | ||
| locales | ||
| Providers | ||
| svgs | ||
| test | ||
| theme | ||
| utils | ||
| index.ts | ||
| store.ts | ||