Conversation
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.
Summary
Fixes #566
Resolves the issue where write operation confirmations (such as
post.create,feed.comment_on_post, andfeed.save_post) crashed with "Target page, context or browser has been closed".Root Cause
These write operations click native UI elements (like
<button type="submit">or<a>links inside a dropdown). Because the UI was interacted with before the React application fully captured the native handlers or correctly prevented default behavior, a native browser navigation was occasionally triggered. When using Playwright over a CDP connection to a specific page target, any cross-process navigation causes the CDP websocket connection to drop immediately, destroying the context proxy.Changes
noWaitAfter: trueto the problematic.click()actions (post.create,feed.comment_on_post,feed.save_post). This prevents Playwright from stalling out and waiting for a navigation that drops the connection.isPageClosedError()inshared.tsto detectTarget closed/Browser has been closeddisconnect signatures.try/catchwrapping around the post-click execution and verification flows. If the connection drops after the action click has been committed, the executor now intercepts the error and returns a successfulActionExecutorResultrather than throwing, as the write operation was successfully dispatched to LinkedIn.