Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page assignment before return from get_or_create_page #1837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

satansdeer
Copy link
Contributor

@satansdeer satansdeer commented Feb 25, 2025

Add page assignment before returning page


Important

Assigns page before returning in get_or_create_page() in browser_factory.py to ensure initialization.

  • Behavior:
    • Assigns page variable before returning in get_or_create_page() in browser_factory.py to ensure it is initialized.
  • Functions:
    • Modifies get_or_create_page() to include page = await self.get_working_page() before returning.

This description was created by Ellipsis for 5a1c7e3. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 5a1c7e3 in 1 minute and 35 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. skyvern/webeye/browser_factory.py:549
  • Draft comment:
    Consider capturing the return value of __assert_page() (which already guarantees a valid page) instead of calling get_working_page() again. This reduces duplicate async calls and potential state inconsistencies.
  • Reason this comment was not posted:
    Marked as duplicate.
2. skyvern/webeye/browser_factory.py:493
  • Draft comment:
    Typo detected: 'target_lenght' should be renamed to 'target_length' for clarity and correctness.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. skyvern/webeye/browser_factory.py:602
  • Draft comment:
    Typo detected: 'excuted' should be corrected to 'executed' to properly describe that the browser cleanup has been completed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. skyvern/webeye/browser_factory.py:618
  • Draft comment:
    Typo detected: 'broswer' should be corrected to 'browser' in the log message to avoid confusion.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_ft2wXvzc6XbQI0A8


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -549,6 +549,8 @@ async def get_or_create_page(
)
await self.__assert_page()

page = await self.get_working_page()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider capturing the return of __assert_page() directly (since it returns a Page) instead of calling get_working_page() again. This ensures consistency and avoids duplicate calls.

Suggested change
page = await self.get_working_page()
page = await self.__assert_page()

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.

1 participant