FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: forward cancelled tasks to the inner task by mxschmitt · Pull Request #1236 · microsoft/playwright-python · GitHub

fix: forward cancelled tasks to the inner task - #1236

Merged
Max Schmitt (mxschmitt) merged 2 commits into
microsoft:mainfrom
mxschmitt:fix-forward-cancel
Apr 7, 2022
Merged

fix: forward cancelled tasks to the inner task#1236
Max Schmitt (mxschmitt) merged 2 commits into
microsoft:mainfrom
mxschmitt:fix-forward-cancel

Conversation

Max Schmitt (mxschmitt) commented Apr 4, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes #1210

Imagine Page.waitForSelector, if a user cancels one of these api calls, the internal protocol calls are still pending and don't get canceled. When one of these errors out it setts the exception and it ends up in 'Future exception was never retrieved' (asyncio warning). I thought about two ways so far of fixing it:

a) if the outer task gets canceled "propagate" the canceled signal down to the protocol api call, see here for an impl: 2f8041c
b) store the "outer task" inside the ProtocolCallback class and check when receiving the error if it was canceled: https://github.com/microsoft/playwright-python/pull/1236/files

Not sure whats better! b) is definitely less code.

The failing lint is unrelated, it gets fixed in #1237.

Max Schmitt (mxschmitt) force-pushed the fix-forward-cancel branch 5 times, most recently from 47dbae1 to 2c998a1 Compare April 4, 2022 19:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Future exception was never retrieved

2 participants


Back | FazBrowse Home | New Git URL