Skip to content
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

fix(developer): handle KM_CORE_IT_INVALIDATE_CONTEXT in debugger #11488

Merged

Conversation

mcdurdin
Copy link
Member

The output from Keyman Core changed in #11172 to emit a KM_CORE_IT_INVALIDATE_CONTEXT action when a frame key is pressed, but the debugger was not catering for this scenario, causing an assertion failure.

Fixes: #11486
Fixes: KEYMAN-DEVELOPER-1Y4

User Testing

TEST_DEBUGGER_KEYS: In the Keyman Developer debugger window, press a variety of keys, including letter keys, arrow keys, and more. The debugger should no longer crash.

The output from Keyman Core changed in #11172 to emit a
`KM_CORE_IT_INVALIDATE_CONTEXT` action when a frame key is pressed, but
the debugger was not catering for this scenario, causing an assertion
failure.

Fixes: #11486
Fixes: KEYMAN-DEVELOPER-1Y4
@mcdurdin mcdurdin requested a review from darcywong00 as a code owner May 21, 2024 02:04
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels May 21, 2024
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented May 21, 2024

User Test Results

Test specification and instructions

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S2 milestone May 21, 2024
@mcdurdin mcdurdin changed the title fix(developer): handle KM_CORE_IT_INVALIDATE_CONTEXT in debugger fix(developer): handle KM_CORE_IT_INVALIDATE_CONTEXT in debugger May 21, 2024
@@ -360,6 +360,13 @@ function TDebugEventList.AddStateItems(

AddDebugItem(debug, debugkeyboard, vk, modifier_state);

if action._type = KM_CORE_IT_INVALIDATE_CONTEXT then
begin
// We always ignore invalidate context which can come when a frame key is
Copy link
Contributor

Choose a reason for hiding this comment

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

lgtm.
Is this the same behavior on a non-debug event?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, the debugger specifically ignores the invalidate context event because it always tracks the context, including markers. It's the only app that ever knows about markers, so it's the only app that can ignore the event.

Copy link
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@rc-swag rc-swag left a comment

Choose a reason for hiding this comment

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

lgtm

@dinakaranr
Copy link

Test Results

  • TEST_DEBUGGER_KEYS (PASSED):
    I tested this issue with the attached "Keymandeveloper-18.0.40-alpha-test-11488" build on the Windows 11 OS environment: Here is my observation.
  1. Installed the "keymandeveloper-18.0.40.exe" file.
  2. Double-click on the "Keyman Developer" icon. The developer tool appeared correctly.
  3. Open the Keyman keyboard project (*.kpj) file.
  4. Open any keyman keyboard (*.kmn) file. (e.g., Tamil 99 text)
  5. Navigate to the Debugger mode by pressing the F5 or (On build tab/Start Debugging).
  6. Navigate to the Layout tab. Click on an empty text box.
  7. Type a letter. Press the CTRL+Z, CTRL+A, CTRL+V backspace, Delete, and special characters keys too.
    Here, There is no crash message appears in the debugger mode. It works well. Thank you.
    Note: There is no build available under the "Test Artifacts" So, I downloaded it from "merge-status-list"(Test Keyman Developer)

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label May 21, 2024
@mcdurdin mcdurdin merged commit 78de7e9 into master May 22, 2024
5 checks passed
@mcdurdin mcdurdin deleted the fix/developer/11486-handle-invalidate-context-in-debugger branch May 22, 2024 03:56
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

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

post merge LGTM

"I ignore invalidate context" could be part of the core API but probably not needed.

@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 18.0.41-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(developer): unexpected KM_CORE_IT_INVALIDATE_CONTEXT causes EAssertionFailed in debugger
6 participants