playwright/packages/playwright-core
Yury Semikhatsky 7a72adc33c
cherry-pick(#29180): fix: interception id not found error in route.co… (#29222)
…ntinue

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-29 09:33:09 -08:00
..
bin fix: Google Chrome Beta/Stable install on macOS (#27880) 2023-10-31 16:49:13 +01:00
bundles chore: get rid of rimraf package (#27790) 2023-10-26 19:41:00 +02:00
src cherry-pick(#29180): fix: interception id not found error in route.co… (#29222) 2024-01-29 09:33:09 -08:00
types docs: update auto-waiting doc (#28960) 2024-01-12 09:33:42 -08: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(webkit): roll to r1967 (#28952) 2024-01-12 15:01:47 +01:00
cli.js chore: fix playwright-core cli (#23203) 2023-05-22 12:37:08 -07: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: mark 1.41.1 (#29075) 2024-01-20 00:05:04 +01: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.