bug(android): bad order of operations for updating keyboard state
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
While collecting data via profiling for a different task, I ran into proof of an internal race condition:
[Chrome performance profile (.json)](https://github.com/keymanapp/keyman/files/14860632/sus.android.keyboard.swap.json)
Note the timestamps in the following images:

Web has been told to load a keyboard; this, of course, requires fetching it.
The usual _post-keyboard load_ update:

The keyboard script _actually_ loading, being processed, and moving toward display of the OSK:

Note: _**those last two steps are out of order!**_
Fortunately... we do a context-reset anyway once the keyboard load is complete, so I _believe_ that, at present, this has no net effect. (So, I've marked it as low-priority for now.) The fact that this can occur does appear significant though, so I wanted to note it in case it matters at some point in the future. I'd have assumed that this ordering would never occur.
Contributor guide
Assessment
This issue has not been assessed yet.