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

[js] add ErrorCode for DetachedShadowRootError #15455

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Mar 19, 2025

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Add ErrorCode for DetachedShadowRootError

Motivation and Context

Fixes #13580

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Bug fix


Description

  • Added a new error code DETACHED_SHADOW_ROOT to ErrorCode.

  • Mapped DETACHED_SHADOW_ROOT to DetachedShadowRootError in error handling.

  • Enhanced error handling for detached shadow root scenarios.


Changes walkthrough 📝

Relevant files
Bug fix
error.js
Introduced `DETACHED_SHADOW_ROOT` error code and mapping 

javascript/node/selenium-webdriver/lib/error.js

  • Added DETACHED_SHADOW_ROOT with code 65 to ErrorCode.
  • Mapped DETACHED_SHADOW_ROOT to DetachedShadowRootError in
    LEGACY_ERROR_CODE_TO_TYPE.
  • +2/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis 🔶

    13580 - Partially compliant

    Compliant requirements:

    • Fix the issue where a "detached shadow root" error is not properly translated to DetachedShadowRootException

    Non-compliant requirements:

    • Ensure the ErrorHandler uses ErrorCodec to decode the error instead of non-W3C ErrorCodes

    Requires further human verification:

    • Verify that the implementation properly handles the specific test case mentioned in the ticket
    • Confirm that newer W3C errors are now properly identified

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Implementation Approach

    The PR adds a new error code but doesn't address the root cause mentioned in the ticket about using ErrorCodec instead of non-W3C ErrorCodes. This may be a partial solution that doesn't fully resolve the underlying issue.

    DETACHED_SHADOW_ROOT: 65,
    METHOD_NOT_ALLOWED: 405,

    Copy link
    Contributor

    qodo-merge-pro bot commented Mar 19, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [🐛 Bug]: "detached shadow root" not translated to DetachedShadowRootException
    2 participants