Add significantly more debug logging to UIAHandler#14256
Merged
Conversation
Contributor
|
Subscribing as it will impact Event Tracker add-on once this PR is merged (if merged, I will declare Event Tracker as a legacy add-on). Thanks.
|
seanbudd
reviewed
Oct 17, 2022
| if not windowHandle: | ||
| if UIAHandler._isDebug(): | ||
| log.debug( | ||
| f"No windowHandle for UIA NvDAObject. " |
Member
There was a problem hiding this comment.
Fix capitalization of NVDA
Suggested change
| f"No windowHandle for UIA NvDAObject. " | |
| "No windowHandle for UIA NVDAObject. " |
Member
There was a problem hiding this comment.
this is still an issue, same with the unnecessary f-strings.
However, as the remaining changes are trivial, I am approving in the mean-time
Member
|
Mostly trivial changes remaining |
Co-authored-by: Sean Budd <sean@nvaccess.org>
See test results for failed build of commit a634d7edaa |
seanbudd
approved these changes
Oct 18, 2022
…so debug messages are produced if isUIAWindow is also being debugged.
Member
Author
|
@seanbudd I've changed all unnecessary f-strings to regular strings, and also added a missing isDebug argument to the call to _isUIAWindowHelper. So another review please. |
seanbudd
approved these changes
Oct 20, 2022
See test results for failed build of commit 536be0f087 |
See test results for failed build of commit b1238b2a9e |
6 tasks
michaelDCurran
added a commit
that referenced
this pull request
Oct 31, 2022
…ot be created. (#14314) Fixes regression introduced in pr #14256 Summary of the issue: Sometimes a UIA focus event handler can't create an NVDAObject for the element being focused. Normally, in this situation, the event would be silently dropped. However, with the introduction of extra debugging for UIA events in pr #14256, a return was accidently removed, which meant that the shouldAllowUIAFocusEvent attribute tried to be looed up on the None (failed NVDAObject). This caused a noisy traceback in the log at level error. Description of user facing changes A noisy error traceback is no longer produced when NVDA cannot handle certain broken UIA focus events. Description of development approach Make sure to return if instantiating the NVDAObject produces None.
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:
None.
Summary of the issue:
Although NVDA has a specific uIA debug logging category, this does not really enable all that many more log messages a part from some debug warnings. thus it is almost useless to ask for a user's log with this flag enabled.
Description of user facing changes
Setting NVDA's log level to debug, and enabling the UIA debug logging category in NVDA's advanced settings panel, will now produce significantly more logging for UIA. This includes logging when all UIA event handler methods are called, along with their parameters, and logging for utility utility methods such as checking if a window or element is native UIA.
Description of development approach
Added a bunch of methods to UIAHandler for generating a string representation for debugging, for things such as UIA elements, property IDs, event IDs, notification types etc.
Added conditional debug logging to all UIA event handler methods, plus isUIAWindow, isNativeUIAElement and getNearestWindowhandle.
Testing strategy:
Ran NVDA for a day or so, performing general tasks, using multiple apps that are native UIA.
Used the new debug logging to aide in investigating QT issues.
Known issues with pull request:
None known.
Change log entries:
New features
Changes
Bug fixes
For Developers
Code Review Checklist: