staging CI green-up: P-1 apply-slot wedge under JSPI, popup P-4 regression, ysync double-seed header, spec fixes

- P-1 (findings-p.spec P-1c red on CI + locally): a JS exception thrown from a
  window.kicadCollab wire callback does NOT reach the C++ catch(...) — under
  JSPI it REJECTS the promising coroutine entry, slot.done never flips and the
  apply slot is busy for the page's life. Three layers: libcontext flags the
  rejected record dead (kicad → d0afbc4bd3),
  drainApplies() reaps a !done && !CanResume() body, and every EM_ASM
  window.kicadCollab.onX(...) call is try/catch-guarded (collab_common.h,
  kicad_editor/eeschema/pl_editor embind).
- popup.spec 'dismisses on outside click': wx P-4 SetFocus delegation excluded
  for wxPopupWindow (wxwidgets → a7436d1052).
- ysync-two-tab concurrent seed: repairLayoutY + seedNonce retraction deleted
  both headers (pcbjam-shared → 8dabf2e).
- dark-mode.spec: stale light-mode reference (pre wx fa46f1822c DOM
  re-projection) replaced with the CI chromium render.
- items-wire-batch-loss.spec: precondition obsolete after P-5 — poisoned entry
  is now synthetic, plus a P-5 contract assertion (field blob == '').
- presence-ghost-peer.spec: skip early when no /parties/ socket (CI web e2e
  runs the BroadcastChannel provider); findings-p1.spec: polled click-select
  precondition.

Local: kicad-chromium findings/presence/ysync/collab 59/59, popup 7/7,
dark-mode 1/1, pcbjam-shared vitest 249/249.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LvvARNMxQrq17vogn3REMU
This commit is contained in:
Gergő Törcsvári 2026-08-28 22:25:21 +02:00
commit c4bdaad7a0
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
11 changed files with 166 additions and 54 deletions

View file

@ -79,16 +79,24 @@ test('P-1 standalone: fit lands after a keyboard rotate of a clicked footprint',
await bootBoard(page, 'alice');
const fp = await firstFootprint(page);
expect(await fitLands(page, { cx: fp.x, cy: fp.y, hw: 15e6, hh: 10e6 }), 'fit before edit').toBe(true);
const box = await glBox(page);
const vp = await viewport(page);
const sx = box.x + (fp.x - vp.cx) * vp.scale + vp.w / 2;
const sy = box.y + (fp.y - vp.cy) * vp.scale + vp.h / 2;
await page.mouse.move(sx, sy);
await page.waitForTimeout(300); // eslint-disable-line -- pointer dwell
await page.mouse.down();
await page.mouse.up();
await page.waitForTimeout(400); // eslint-disable-line -- selection dwell
const sel = await page.evaluate(() => JSON.parse((window as unknown as W).Module.kicadCollabGetSelection()));
// Click-select, re-projected from the LIVE viewport each attempt: on CI the
// first click after the fit can land before the canvas has re-rendered at
// the new zoom (selection = []), so poll the real selection, not one click.
const selection = (): Promise<string[]> =>
page.evaluate(() => JSON.parse((window as unknown as W).Module.kicadCollabGetSelection()));
await expect.poll(async () => {
const box = await glBox(page);
const vp = await viewport(page);
const sx = box.x + (fp.x - vp.cx) * vp.scale + vp.w / 2;
const sy = box.y + (fp.y - vp.cy) * vp.scale + vp.h / 2;
await page.mouse.move(sx, sy);
await page.waitForTimeout(300); // eslint-disable-line -- documented interaction dwell (pointer hover before press)
await page.mouse.down();
await page.mouse.up();
await page.waitForTimeout(400); // eslint-disable-line -- documented interaction dwell (selection tool commit)
return (await selection()).includes(fp.id);
}, { timeout: 20000, intervals: [500], message: 'click-select of the first footprint' }).toBe(true);
const sel = await selection();
const r0 = await rotation(page, fp.id);
await page.keyboard.press('r');
const rotated = await expect.poll(() => rotation(page, fp.id), { timeout: 10000 }).not.toBe(r0).then(() => true, () => false);