HP Secure Browser support (#16377): Amend browseMode dead document detection to cope with VT_EMPTY runtimeID.#16393
Merged
Conversation
…ument detection to cope with VT_EMPTY runtimeID. Summary of the issue: When enough websites are open in separate tabs, SB will suspend some of the virtual machines hosting the websites to disk. This can cause UIA documents representing these websites to become dead. In this scenario querying UIA_RuntimeIdPropertyId of the dead document returns VT_EMPTY variant, causing uncaught exception raised from UIABrowseModeDocument.__contains__. This keeps repeating, preventing NVDA from working correctly, if at all. Description of user facing changes: NVDA works correctly regardless of vm suspensions or other scenarios where UIA documents can become dead. Description of development approach: UIABrowseModeDocument.__contains__ already has code to detect dead documents, however it relies on COMError being reported from UIA_RuntimeIdPropertyId property query. In my testing, even when the server side reports an error HRESULT from IRawElementProviderFragment::GetRuntimeID() uia method, UIA core appears to translate it into a successful property query, yet with a VT_EMPTY variant as the property value. It's possible this behaviour is different between various UIA core versions, my testing is primarily on Windows 11 build 22631. We amend the detection such that both COMError and VT_EMPTY variant are detected and treated equally, causing the dead document codepath to execute.
seanbudd
approved these changes
Apr 16, 2024
tomaszw
pushed a commit
to tomaszw/nvda-hp
that referenced
this pull request
Apr 17, 2024
…access#16395 Summary of the issue: Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395 Description of user facing changes: Added Changelog entries Description of development approach: N/A
5 tasks
tomaszw
pushed a commit
to tomaszw/nvda-hp
that referenced
this pull request
Apr 17, 2024
…access#16395 Summary of the issue: Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395 Description of user facing changes: Added Changelog entries Description of development approach: N/A
tomaszw
pushed a commit
to tomaszw/nvda-hp
that referenced
this pull request
Apr 17, 2024
…access#16395 Summary of the issue: Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395 Description of user facing changes: Added Changelog entries Description of development approach: N/A
seanbudd
added a commit
that referenced
this pull request
Apr 18, 2024
* Changelog entries for #16392 #16393 #16394 #16395 Summary of the issue: Changelog entries are missing for #16392 #16393 #16394 #16395 Description of user facing changes: Added Changelog entries Description of development approach: N/A * Apply suggestions from code review --------- Co-authored-by: Tomasz Wroblewski <tomasz.wroblewski@hp.com> Co-authored-by: Sean Budd <seanbudd123@gmail.com>
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.
Link to issue number:
#16377
Summary of the issue:
When enough websites are open in separate tabs, SB will suspend some of the virtual machines hosting the websites to disk. This can cause UIA documents representing these websites to become dead.
In this scenario querying UIA_RuntimeIdPropertyId of the dead document returns VT_EMPTY variant, causing uncaught exception raised from UIABrowseModeDocument.contains. This keeps repeating, preventing NVDA from working correctly, if at all.
Description of user facing changes
NVDA works correctly regardless of vm suspensions or other scenarios where UIA documents can become dead.
Description of development approach
UIABrowseModeDocument.contains already has code to detect dead documents, however it relies on COMError being reported from UIA_RuntimeIdPropertyId property query.
In my testing, even when the server side reports an error HRESULT from IRawElementProviderFragment::GetRuntimeID() uia method, UIA core appears to translate it into a successful property query, yet with a VT_EMPTY variant as the property value. It's possible this behaviour is different between various UIA core versions, my testing is primarily on Windows 11 build 22631.
We amend the detection such that both COMError and VT_EMPTY variant are detected and treated equally, causing the dead document codepath to execute.
Testing strategy:
Manual testing
Known issues with pull request:
N/A
Code Review Checklist: