Skip to content

Commit c37e795

Browse files
committed
test(web): assert the deep-link 409 race actually reaches the connect phase
Copilot round 2: the "swallows the already-exists race and still connects" test only asserted that nothing was recorded, so a deep link that swallowed the 409 and then stopped forever would have stayed green. Rerender with the hydrated row and wait for the connect. Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 005e4c6 commit c37e795

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎clients/web/src/hooks/useConnectionLifecycle.test.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,15 @@ describe("useConnectionLifecycle", () => {
917917

918918
await waitFor(() => expect(addServerImpl).toHaveBeenCalled());
919919
expect(h.api().connectErrorMessage).toBeUndefined();
920+
921+
// A 409 means the row is already on disk, so hydration surfaces it on a
922+
// later render and the connect phase must still run. Asserting only that
923+
// nothing was recorded would stay green for a deep link that swallows the
924+
// error and then stops forever.
925+
const fresh = entry(DEEP_LINK_SERVER_ID, { config: deepLinkConfig });
926+
h.rerender({ servers: [fresh], deepLink: link, addServerImpl });
927+
await waitFor(() => expect(connectSpy).toHaveBeenCalled());
928+
expect(h.api().connectErrorMessage).toBeUndefined();
920929
});
921930

922931
it("records any other add failure on the machine-readable surface", async () => {

0 commit comments

Comments
 (0)