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(web): enhances integrated test stability #9718

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Oct 9, 2023

This corresponds to an occasionally-seen test failure error from the build logs in which we'd get an error corresponding to this block of code:

if(lastElem && lastElem._kmwAttachment.keyboard != null) {
lastElem._kmwAttachment.keyboard = keyboardID;
lastElem._kmwAttachment.languageCode = langCode;
} else {

The error would match line 533, stating an inability to read the keyboard field due to _kmwAttachment being null / undefined.

The actual trigger:

/**
* Reset context when entering or exiting the active element.
* Will also trigger OSK shift state / layer reset.
**/
private pageFocusHandler: (e: FocusEvent) => boolean = () => {
if(!this.focusAssistant.maintainingFocus && this.engine.osk?.vkbd) {
this.engine.contextManager.deactivateCurrentTarget();
this.engine.contextManager.resetContext();
}
return false;
}

This event handler is called on page events, rather than events related to attached elements. But... on line 87, it calls a method that relates to attached elements... and so a niche case related to management of recently-attached elements had slipped through the cracks until now.

Discovered during work on #9657 and #9690. I've gone ahead and included its changes there, but this is easy enough to 🍒 out of the feature branch and make its own PR here.

@keymanapp-test-bot skip

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 9, 2023

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S23 milestone Oct 9, 2023
@mcdurdin
Copy link
Member

mcdurdin commented Oct 9, 2023

You need to update your master branch locally... iOS builds failing due to expired certificate.

@mcdurdin
Copy link
Member

mcdurdin commented Oct 9, 2023

Can you add a link to a build which failed before this fix?

@jahorton
Copy link
Contributor Author

Can you add a link to a build which failed before this fix?

That would take some hunting. It's something I've sporadically seen in the past, but I don't remember seeing it within the past week. If you want me to spend that time, I can... but I figure it's effort best spent elsewhere at this point.

@mcdurdin
Copy link
Member

That would take some hunting. It's something I've sporadically seen in the past, but I don't remember seeing it within the past week. If you want me to spend that time, I can... but I figure it's effort best spent elsewhere at this point.

I'd appreciate it because right now I don't know what this is fixing.

@jahorton
Copy link
Contributor Author

That would take some hunting. It's something I've sporadically seen in the past, but I don't remember seeing it within the past week. If you want me to spend that time, I can... but I figure it's effort best spent elsewhere at this point.

I'd appreciate it because right now I don't know what this is fixing.

I don't see anything recent enough in any of the listed TC logs. I know I've seen something about this in the past, but apparently it's too far back.

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

LGTM? It's a little hard to be clear on the exact sequence of events and the complex web of event handlers but it's basically a race condition, yeah?

@mcdurdin mcdurdin modified the milestones: A17S23, A17S24 Oct 15, 2023
@jahorton jahorton merged commit 374b1fa into master Oct 20, 2023
14 of 15 checks passed
@jahorton jahorton deleted the fix/web/integrated-test-stability branch October 20, 2023 09:17
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.196-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.

3 participants