Skip to content

Only close seika connection if initialized#13684

Merged
seanbudd merged 6 commits into
betafrom
revertconfigFixes
May 16, 2022
Merged

Only close seika connection if initialized#13684
seanbudd merged 6 commits into
betafrom
revertconfigFixes

Conversation

@seanbudd

@seanbudd seanbudd commented May 11, 2022

Copy link
Copy Markdown
Member

Link to issue number:

Closes part of #13679

Summary of the issue:

It appears that when resetting a config, the seika notetaker driver can be terminated before it has been initialized.

Description of how this pull request fixes the issue:

Only terminate the notetaker driver if it has been initialized.

Testing strategy:

Known issues with pull request:

Another issue is highlighted in #13679. While terminating/initializing during a config change, the braille.handler is attempted to be used when handling events on NVDA objects.
This is a more complex problem and needs a braille device to reproduce and test.

Change log entries:

Fixes an unreleased regression

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

@cary-rowen

Copy link
Copy Markdown
Contributor

I tested this and still reproduce #13679

@cary-rowen

Copy link
Copy Markdown
Contributor

log.txt

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 72ce6ecf1f

@cary-rowen

Copy link
Copy Markdown
Contributor

Hi, @seanbudd
I tested the latest build and NVDA can catch this error:

ERROR - brailleDisplayDrivers.seikantk.BrailleDisplayDriver.terminate (10:50:45.576) - MainThread (10400):
Seika Notetaker driver not initialized

There seems to be another Error and I'm not quite sure how it happened:

RuntimeError: wrapped C/C++ object of type BoxSizer has been deleted
ERROR - unhandled exception (10:50:45.697) - MainThread (10400):
Traceback (most recent call last):
  File "wx\core.pyc", line 3407, in <lambda>
  File "gui\settingsDialogs.pyc", line 1457, in refreshGui

But my configuration can be reverse as expected.

Below is the full log:
log.txt

@seanbudd

Copy link
Copy Markdown
Member Author

Thanks @cary-rowen - I will change the log level of that message but this is as expected.

@seanbudd seanbudd marked this pull request as ready for review May 12, 2022 03:33
@seanbudd seanbudd requested a review from a team as a code owner May 12, 2022 03:33
@seanbudd seanbudd requested a review from feerrenrut May 12, 2022 03:33
@XLTechie

XLTechie commented May 12, 2022 via email

Copy link
Copy Markdown
Collaborator

@seanbudd

Copy link
Copy Markdown
Member Author

Rowen wrote:
There seems to be another Error and I'm not quite sure how it happened: RuntimeError: wrapped C/C++ object of type BoxSizer has been deleted
I have also been seeing that on config resets lately. I suspect it is being caused by an add-on not (properly) cleaning up its config panel in terminate(), but haven't gone through the hassle of figuring out which one yet, if it is one and not core. Unfortunately it doesn't happen with every reset, so has been difficult to pin down. Next time please post a debug log.

This is a problem with NVDA core - I have noticed this without add-ons installed.

@cary-rowen

Copy link
Copy Markdown
Contributor

Hi, @seanbudd

I tested it again and it seems to be working fine so far, Thanks for your efforts.
Please remember to put it on the 2022.1 milestone.

Thanks

@seanbudd seanbudd self-assigned this May 12, 2022
@seanbudd

seanbudd commented May 12, 2022

Copy link
Copy Markdown
Member Author

Hi, @seanbudd

I tested it again and it seems to be working fine so far, Thanks for your efforts. Please remember to put it on the 2022.1 milestone.

Thanks

Please refer to this comment I've added to the issue
#13679 (comment)


class BrailleDisplayDriver(braille.BrailleDisplayDriver):
_dev: hwIo.IoBase
_dev: Optional[hwIo.IoBase] = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this actually be made an instance variable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been changed in a146544

Comment thread source/braille.py Outdated
except Exception as e:
# The display driver seems to be failing, but we're terminating anyway, so just ignore it.
pass
log.debugWarning(f"Display driver {self} is failing while terminating. {e}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be logged at error level?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this has been changed in 941823b

@seanbudd

Copy link
Copy Markdown
Member Author

@cary-rowen - if we end up doing a 2022.1rc2 due to #13694, I think the fix for this issue should be included as well.

@cary-rowen

Copy link
Copy Markdown
Contributor

@seanbudd
I agree, I'll take a look too #13694

@seanbudd seanbudd changed the base branch from master to beta May 16, 2022 04:06
@seanbudd seanbudd requested a review from feerrenrut May 16, 2022 04:15
@seanbudd seanbudd merged commit 7b488cc into beta May 16, 2022
@seanbudd seanbudd deleted the revertconfigFixes branch May 16, 2022 06:04
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone May 16, 2022
@seanbudd seanbudd modified the milestones: 2022.2, 2022.1 May 16, 2022
@seanbudd seanbudd linked an issue May 19, 2022 that may be closed by this pull request
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.

Revert configuration gives error

6 participants