keymanapp / keymanapp/keyman

bug(ios): app hanging for more than 2000ms during system-keyboard startup

Open
#12,218 6 comments 0 reactions 0 assignees View on GitHub
bug ios/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

### Describe the bug

Relates to #1492.

We have quite a number of Sentry reports in which our iOS system keyboard is terminated due to taking too long to initialize. This termination tends to happen in a number of places within the code; after all, it's a externally-based time-triggered termination.

Good point-of-reference report: https://keyman.sentry.io/issues/5518064391/events/ca1f3a0ca13e4c0fb3f3408a3aa9e821/

As can be seen from the linked report above, we sometimes have repeated page-reloading occurring as the system-keyboard is starting up. Using the same Breadcrumbs section -> View All pattern, we can see a number of reloads all triggered within the span of two seconds.
- Earliest visible "Keyboard loaded" breadcrumb: 03:37:10.476
- Last one: 03:37:12.502
- Count: 8 (!)

That's _eight_ times that the function below - which triggers when the keyboard host-page finishes loading - was triggered within the span of two seconds:

https://github.com/keymanapp/keyman/blob/402b1964f2c654496b555ceddc858b3d19fc911e/ios/engine/KMEI/KeymanEngine/Classes/Keyboard/KeymanWebViewController.swift#L593-L600

The report above in particular is interesting for an extra reason - it fits a pattern for some of the "overused RAM" reports and even includes a "low memory" event notification in its logs.

----

Note: not all cases are during the initial load. This one has the same report title, but it's triggered at a distinctly different point within the keyboard lifecycle: https://keyman.sentry.io/issues/5368749989/events/24c32ecb945d4932bc6ecc8451ba6fb2/

### Reproduce the bug

_No response_

### Expected behavior

_No response_

### Related issues

_No response_

### Keyman apps

- [ ] Keyman for Android
- [ ] Keyman for iPhone and iPad
- [ ] Keyman for Linux
- [ ] Keyman for macOS
- [ ] Keyman for Windows
- [ ] Keyman Developer
- [ ] KeymanWeb
- [ ] Other - give details at bottom of form

### Keyman version

_No response_

### Operating system

_No response_

### Device

_No response_

### Target application

_No response_

### Browser

_No response_

### Keyboard name

_No response_

### Keyboard version

_No response_

### Language name

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.