fix: Fix the order in which cookies are saved to the `SessionCookies` and the handler is executed for `PlaywrightCrawler` by Mantisus · Pull Request #1163 · apify/crawlee-python

added 2 commits

April 18, 2025 18:04

@Mantisus Mantisus changed the title fix: Fix the order in which cookies are saved to the session store and the handler is executed for PlaywrightCrawler fix: Fix the order in which cookies are saved to the SessionCookies and the handler is executed for PlaywrightCrawler

Apr 18, 2025

@Mantisus

Pijukatel

janbuchar

Mantisus added a commit to Mantisus/crawlee-python that referenced this pull request

Apr 24, 2025
… and the handler is executed for `PlaywrightCrawler` (apify#1163)

### Description

- For `PlaywrightCrawler`, cookies should only be saved to the session
store when the handler is fully executed. This is because the browser
may continue to set cookies while the handler is being executed

### Testing

- Add a test simulating the installation of a cookie in the browser
during the `default_handler` execution process
- Update the `test_isolation_cookies` test

Mantisus added a commit to Mantisus/crawlee-python that referenced this pull request

Apr 24, 2025
… and the handler is executed for `PlaywrightCrawler` (apify#1163)

### Description

- For `PlaywrightCrawler`, cookies should only be saved to the session
store when the handler is fully executed. This is because the browser
may continue to set cookies while the handler is being executed

### Testing

- Add a test simulating the installation of a cookie in the browser
during the `default_handler` execution process
- Update the `test_isolation_cookies` test