Repository navigation
fix(context): skip workers without a session and raise a clear error from Target#worker - #669
Merged
Merged
Conversation
…from Target#worker
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A worker target without a session, such as a service worker Ferrum detached from or a worker whose session was detached, broke
Context#workersandTarget#worker.Target#workerbuilt aWorkeronsession(nil)and failed with CDP's "Message may have string 'sessionId' property", andContext#workerslisted dead workers or raised the same error.Fix
Context#workersskips worker and shared worker targets without a session. Since fix(context): reuse the session of an attached target in attach_target #668 the session id is cleared on detach, so this covers detached workers.Target#workerraisesNoSuchTargetErrorwhen there's no session, pointing toContext#attach_target. Only in flatten mode, the non-flatten one connects by target id.Test
spec/worker_spec.rb:browser.workers. Without the fix it stays listed.target.workeron a service worker Ferrum detached from raisesNoSuchTargetError. Without the fix it raises the CDP error.