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

Field undefined when trying to listen on it #9175

Closed
1 task done
noefleury opened this issue May 14, 2024 · 4 comments
Closed
1 task done

Field undefined when trying to listen on it #9175

noefleury opened this issue May 14, 2024 · 4 comments
Labels
browser Browser Extension bug

Comments

@noefleury
Copy link

noefleury commented May 14, 2024

Steps To Reproduce

When navigating through views in some apps, this bug could happen.

More precisely, when an element appears and the url is changing at the same time (works in both orders).

It could be for example be triggered by a button.

<!-- trigger.html -->

<button onclick="triggerBug()">test</button>

<input type="password" style="display: none" id="example">

<script>

    function triggerBug() {
        document.getElementById('example').style.display = 'inline-block';
        window.history.pushState({}, '', 'triggered');
    }

</script>

Expected Result

Just to don't throw an error.

Actual Result

In file bootstrap-autofill-overlay.js:4267

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'viewable')
    at CollectAutofillContentService.<anonymous> (bootstrap-autofill-overlay.js:4267:53)
    at Generator.next (<anonymous>)
    at fulfilled (bootstrap-autofill-overlay.js:4111:58)

Screenshots or Videos

No response

Additional Context

Broken due to release 2024.4.1, more precisely this commit : 77cfa8a#diff-8ff1ef69519807ae86fc872374b223656c9459d1b8b0304e8a2b602182b68f98R1349

Operating System

macOS

Operating System Version

No response

Web Browser

Chrome

Browser Version

No response

Build Version

2024.4.2

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@cagonzalezcs
Copy link
Contributor

Hmm, I checked out your linked PR.

I'm wondering if it makes more sense to return early from the method if the element has not been cached, rather than process it. In the context of that intersection observer, if an element hasn't been previously cached then it likely shouldn't be triggering the update in either regard... it might not be entirely wrong to add the element to the list of autofill elements... but again, given the context of the intersection observer, we should only be re-evaluating visibility if the element has been previously found in the DOM.

@cagonzalezcs
Copy link
Contributor

Resolved by #9279

@sysmat
Copy link

sysmat commented May 27, 2024

error still present in chrome: Version 125.0.6422.113 (Official Build) (64-bit)

@noefleury
Copy link
Author

error still present in chrome: Version 125.0.6422.113 (Official Build) (64-bit)

Yes because the last release 2024.5.0 was made before the merged fix. Should be available soon.

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

Successfully merging a pull request may close this issue.

3 participants