Skip to content

Improve logging and typing for sysListView32#13657

Merged
seanbudd merged 8 commits into
masterfrom
sysListView32FallBackToOOP
May 6, 2022
Merged

Improve logging and typing for sysListView32#13657
seanbudd merged 8 commits into
masterfrom
sysListView32FallBackToOOP

Conversation

@seanbudd

@seanbudd seanbudd commented May 3, 2022

Copy link
Copy Markdown
Member

Link to issue number:

Fix up of #13560, #13271

Summary of the issue:

When out-of-process failed, an empty array was returned instead of None.
This could have led to incorrect reporting of list items.
For example, trying to get the contents of the second column of the list/table/report, the array is initialized with all values of zero, if used without being filled with valid data all columns will report the same thing.

#13271 notes:

How likely are cases where injection doesn't work and the outproc variants succeed? I guess this is pretty unlikely, unless we're running under Windows Store.

  • If injection doesn't work there will be no helperLocalBindingHandle, out of process approach will be tried.
  • If an application like StartIsBack/StartAllBack doesn't handle the Windows Message properly then it doesn't matter if the message is sent in-process or out-of-process.

Description of how this pull request fixes the issue:

  • When possible, use in process approach to get the column order array. It should be possible if there is a helperLocalBindingHandle
  • Don't return an array filled with zeros, return None when out-of-process fails.

Testing strategy:

Manual testing:

Confirm affected applications are tested, outlined in #8175 (comment)

  • TortoiseSVN
  • File Explorer

Known issues with pull request:

Navigation of menu items using StartIsBack/StartAllBack is still broken #13659.

When navigating through the start menu with the application StartAllBack/StartIsBack installed, a layer is created over file explorer. NVDA uses the file explorer app module, but fetching the column order array with SendMessage fails.
We fetch the column order array (LVM_GETCOLUMNORDERARRAY) with SendMessage. While other related ListView messages are successful, we cannot be determine the correct data without a known column order array.

When this fails, 3 different errors are reported:

We are uncertain why this fails, but expect it is to do with the StartIsBack/StartAllBack dll that is injected into file explorer.
Other messages succeed.

Change log entries:

Not needed, minor fix up without expected user changes.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@seanbudd seanbudd added this to the 2022.1 milestone May 3, 2022
@seanbudd seanbudd marked this pull request as ready for review May 3, 2022 01:30
@seanbudd seanbudd requested a review from a team as a code owner May 3, 2022 01:30
@seanbudd seanbudd requested review from a team, LeonarddeR, feerrenrut and michaelDCurran and removed request for a team May 3, 2022 01:30
@AppVeyorBot

This comment was marked as off-topic.

Comment thread source/NVDAObjects/IAccessible/sysListView32.py
@lukaszgo1

Copy link
Copy Markdown
Contributor

Do we understand why in-process fails in this case? Are you planning to follow this up for 2022.2 perhaps by adding additional logging to the in-process code to fix this properly?

@CyrilleB79

Copy link
Copy Markdown
Contributor

According to #13659 (comment), the build of this PR fixes #13659.

@seanbudd

This comment was marked as resolved.

@feerrenrut

Copy link
Copy Markdown
Contributor

For reference the docs to LVM_GETCOLUMNORDERARRAY and SendMessage

@seanbudd When SendMessage fails, can you use GetLastError to extend the log message.

Comment thread source/NVDAObjects/IAccessible/sysListView32.py Outdated
@seanbudd seanbudd marked this pull request as draft May 4, 2022 03:12
@seanbudd

This comment was marked as resolved.

@seanbudd seanbudd force-pushed the sysListView32FallBackToOOP branch from fb2953f to 9bc6445 Compare May 4, 2022 03:32
@seanbudd seanbudd marked this pull request as ready for review May 4, 2022 03:42
@seanbudd seanbudd requested a review from feerrenrut May 4, 2022 03:42
Comment thread source/NVDAObjects/IAccessible/sysListView32.py
@seanbudd seanbudd changed the title Fallback to out of process sysListView32 when in-process fails Fallback to out-of-process sysListView32 when in-process fails May 4, 2022
@seanbudd seanbudd linked an issue May 4, 2022 that may be closed by this pull request
@AppVeyorBot

This comment was marked as off-topic.

seanbudd added a commit that referenced this pull request May 4, 2022
Summary of the issue:
When developing #13657, logging NVDAObject.appModule.helperLocalBindingHandle was helpful.
NVDAObject._get_devInfo is considered too complex, and should aim to be shortened.

Description of how this pull request fixes the issue:
Moves the appModule devInfo logging out of NVDAObject._get_devInfo into AppModule.get_devInfo.
Adds appModule.helperLocalBindingHandle to the log info for an NVDAObject.

Testing strategy:
Test with NVDA+F1 on various NVDAObjects.
@seanbudd seanbudd marked this pull request as draft May 5, 2022 06:04
@seanbudd seanbudd changed the base branch from beta to master May 6, 2022 02:23
@seanbudd seanbudd removed this from the 2022.1 milestone May 6, 2022
@seanbudd seanbudd marked this pull request as ready for review May 6, 2022 02:36
@AppVeyorBot

This comment was marked as off-topic.

@seanbudd seanbudd closed this May 6, 2022
@seanbudd seanbudd reopened this May 6, 2022
Comment thread source/NVDAObjects/IAccessible/sysListView32.py Outdated
@seanbudd seanbudd changed the title Fallback to out-of-process sysListView32 when in-process fails Improve logging and typing for sysListView32 May 6, 2022
@seanbudd seanbudd self-assigned this May 6, 2022
@seanbudd seanbudd merged commit f90caa9 into master May 6, 2022
@seanbudd seanbudd deleted the sysListView32FallBackToOOP branch May 6, 2022 07:32
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 6, 2022
@cary-rowen

Copy link
Copy Markdown
Contributor

Hi @seanbudd
I seem to have found a regression for this PR, and I want to revert the PR to verify my conjecture, but it seems a bit cumbersome.
I don't know how to completely strip this PR in git.
Can anyone have some help?

cary-rowen added a commit to cary-rowen/nvda that referenced this pull request May 24, 2022
@cary-rowen

Copy link
Copy Markdown
Contributor

I found in an application's list Control that NVDA doesn't report list items correctly,
But the program doesn't seem to be convenient for public distribution, I want to revert this pr to test it locally and provide more information later, can I do this using the 'revert' button on this page?

@seanbudd

Copy link
Copy Markdown
Member Author

It looks like this PR should have been included in 2022.1

seanbudd added a commit that referenced this pull request May 26, 2022
Fix up of #13560, #13271

Summary of the issue:

When out-of-process failed, an empty array was returned instead of None.
This could have led to incorrect reporting of list items.
For example, trying to get the contents of the second column of the list/table/report, the array is initialized with all values of zero, if used without being filled with valid data all columns will report the same thing.

#13271 notes:
>How likely are cases where injection doesn't work and the outproc variants succeed? I guess this is pretty unlikely, unless we're running under Windows Store.

- If injection doesn't work there will be no `helperLocalBindingHandle`, out of process approach will be tried.
- If an application like StartIsBack/StartAllBack doesn't handle the Windows Message properly then it doesn't matter if the message is sent in-process or out-of-process.

Description of how this pull request fixes the issue:

- When possible, use in process approach to get the column order array. It should be possible if there is a `helperLocalBindingHandle`
- Don't return an array filled with zeros, return None when out-of-process fails.
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.

8 participants