Skip to content

bug(common/models): Error in ModelCompositor.predict causes keyboard failure #5467

@keyman-sentry

Description

@keyman-sentry

Sentry Issue: KEYMAN-ANDROID-GS

Fatal keyboard error with obolo_chwerty:obolo_chwerty for  language. Loading default keyboard.

The breadcrumb shows:

packageID: obolo_chwerty
keyboardID: obolo_chwerty
keyboardType: SYSTEM
cm_message: Uncaught TypeError: Cannot read property 'sample' of undefined
cm_sourceID: blob:null/2eaf2e9d-75fc-490e-9426-446345506678
keyboardName: Obolo Chwerty
cm_lineNumber: 170

This was a little tricky to track down as we don't yet have good source visibility into the predictive text worker. I used the Chrome Web Inspector to view the blob in minified form, and there was only one reference to sample on line 170, which resolved to ModelCompositor.predict.

So, we appear to be getting an error in ModelCompositor.predict - perhaps an empty array or malformed data?

let inputTransform = transformDistribution.sort(function(a, b) {
return b.p - a.p;
})[0].sample;

Note that this error is occurring with various keyboards, including sil_euro_latin, and not just obolo_chwerty. I have linked related crash reports where I can find them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions