-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Refactor DiffMatchPatch diff handler #16483
Conversation
besides this, some changes and fixes were made to the fast_diff_match_patch (thanks to @beqabeqa473). The fast_diff_match_patch currently can process emoji, and also does not crash when processing large amounts of text. Now all known issues have been fixed and I think nvda could switch back to the fast_diff_match_patch I also refactored the nvda dmp application which could potentially improve performance, @codeofdusk could you review it please? |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Could you please add a change log entry to changes.md, under bug fixes? Please reference the two issues addressed |
@seanbudd, @gerald-hartig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@codeofdusk Can I update submodule and requirements.txt in this pr? |
See #16508. |
On a linux machine, I'm getting several errors like this after a docker compose pull: Exception in DMP, falling back to difflib |
Follow up to nvaccess#16027 Fixes nvaccess#15850 Summary of the issue: Diff Match Patch proxy crashes and the calling thread deadlocks Description of user facing changes Diff Match Patch proxy will become more stable Description of development approach Refactored DiffMatchPatch diff handler. Now, when reading from stdout of a proxy process, if not enough bytes are read, the return code is checked. If a return code was received, an exception is raised and a fallback to difflib occurs.
I was able to reproduce. |
I'd consider usimg utf-32 for data transferrather than utf8.
|
This can probably be fixed by a partial revert of dmp changes. |
The problem described here does not occur with the new fast diff match patch, even when passing strings instead of bytes. |
I created a pr just in case, I will make additional changes if necessary. |
#16483 (comment) Summary of the issue: The current nvda_dmp is out of date. Description of how this pull request fixes the issue: Update nvda_dmp to latest commit.
Link to issue number:
Follow up to #16027
Fixes #15850
Summary of the issue:
Diff Match Patch proxy crashes and the calling thread deadlocks
Description of user facing changes
Diff Match Patch proxy will become more stable
Description of development approach
Refactored DiffMatchPatch diff handler.
Now, when reading from stdout of a proxy process, if not enough bytes are read, the return code is checked.
If a return code was received, an exception is raised and a fallback to difflib occurs.
Testing strategy:
Changes were made to the dmp code that caused it to crash when receiving certain characters.
Next, a test sequence of characters was typed in the terminal, which caused dmp to crash.
Exception messages in dmp and fallback to difflib were logged in the NVDA log.
An attempt to restart NVDA was successful, nvda restarted without delay, and the exit sound was played. This did not happen with deadlocked dmp diff handler.
Known issues with pull request:
None yet
Code Review Checklist: