Repository navigation
Commit ece09d8
authored
fix(studio): drop the resurrected WebMCP polyfill assertion (#3556)
#3516 merged from a branch cut before da6514d and brought back
`expect(document).not.toHaveProperty("modelContext")`, along with the old
test title. This re-applies that fix.
The assertion is racy, not merely wrong. The hook awaits a dynamic import
of the `@mcp-b/global` polyfill inside its mount effect, so whether
`document.modelContext` exists when the assertion runs depends only on
whether that import has resolved yet. `await act()` usually returns first,
which is why main went green while another PR's run went red. Inserting a
100ms wait before the assertion on the current tip makes it fail every
time, and the failure dump shows all five tools registered through the
polyfill: the real behaviour is the opposite of what the line asserted.
Installing `document.modelContext` where the browser has none is the
polyfill's job. What the case is really for is that mounting does not
throw, so a browser without native WebMCP still boots Studio.1 parent faaafbb commit ece09d8
0 file changed
0 commit comments