playwright/packages/playwright-core
Yury Semikhatsky 82981a8091
fix: interception id not found error in route.continue (#29180)
We stopped catching all exceptions in
https://github.com/microsoft/playwright/pull/28539 in hope that we'll
get loadingFailed even before Fetch.continue/fulfill command's error.
Turns out this is racy and may fail if the test cancels the request
while we are continuing it. The following test could in theory reproduce
it if stars align and the timing is good:

```js
it('page.continue on canceled request', async ({ page }) => {
  let resolveRoute;
  const routePromise = new Promise<Route>(f => resolveRoute = f);
  await page.route('http://test.com/x', resolveRoute);

  const evalPromise = page.evaluate(async () => {
    const abortController = new AbortController();
    (window as any).abortController = abortController;
    return fetch('http://test.com/x', { signal: abortController.signal }).catch(e => 'cancelled');
  });
  const route = await routePromise;
  void page.evaluate(() => (window as any).abortController.abort());
  await new Promise(f => setTimeout(f, 10));
  await route.continue();
  const req = await evalPromise;
  expect(req).toBe('cancelled');
});
```

Fixes https://github.com/microsoft/playwright/issues/29123
2024-01-25 16:54:42 -08:00
..
bin chore: better error messages when stable channel installations fail on Windows (#29077) 2024-01-22 18:15:35 +01:00
bundles chore: get rid of rimraf package (#27790) 2023-10-26 19:41:00 +02:00
src fix: interception id not found error in route.continue (#29180) 2024-01-25 16:54:42 -08:00
types feat(chromium): roll to r1100 (#29167) 2024-01-25 15:24:49 +01:00
.eslintrc.js lint: prevent object string concatenation (#23172) 2023-05-19 15:17:43 -07:00
.npmignore chore: fix installation tests (#26602) 2023-08-22 16:48:52 +02:00
browsers.json feat(chromium): roll to r1100 (#29167) 2024-01-25 15:24:49 +01:00
cli.js chore: split cli processing into cli endpoint and program (#29131) 2024-01-23 15:22:09 -08:00
index.d.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.js chore: refactored minimum Node Major version to variable (#24188) 2023-07-18 19:57:48 +02:00
index.mjs fix: export request from index.jsm (#13158) 2022-03-30 09:35:47 -07:00
package.json chore: split cli processing into cli endpoint and program (#29131) 2024-01-23 15:22:09 -08:00
README.md chore: drop dependency on playwright-core in all our packages (#2318) 2020-05-21 13:18:15 -07:00
ThirdPartyNotices.txt chore: use codemirror in the on-hover locator editor (#28090) 2023-11-10 22:00:28 -08:00

playwright-core

This package contains the no-browser flavor of Playwright.