Closed
Bug 1138343
Opened 9 years ago
Closed 9 years ago
[UserDictionary] Instantiate and store an ArrayBuffer instead of a TypedArray during dictionary binary blob generation in KeyboardSettingsApp
Categories
(Firefox OS Graveyard :: Gaia::Keyboard, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.2 S7 (6mar)
People
(Reporter: mnjul, Assigned: mnjul)
References
Details
(Whiteboard: [p=1])
Attachments
(1 file)
+++ This bug was initially created as a clone of Bug #1102834 +++ Bug 1102834 generated and stored the user dictionary blob as a Uint8Array, in KeyboardSettingsApp. IndexedDB does the serialization/marshalling wonderfully so KeyboardApp latin.js loads the blob as Uint8Array too. However, in predictions.js we're also creating create new Uint8Array views for that incoming "blob". Now, at [1], the offset parameter will not see any effect: the second constructor for Uint8Array (see [2]) is called, instead of the fourth, because "buffer" in that context, when called with UserDictionary blob, is a Uint8Array. Thus the "tree" structure is completely wrong and the prediction mechanism breaks. [1] https://github.com/mozilla-b2g/gaia/blob/master/apps/keyboard/js/imes/latin/predictions.js#L196 [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array Let's amend WordListConverter to return an ArrayBuffer to store into IndexedDB (I did a quick test and that seemed to work). Note that other callers of predictions.js pass ArrayBuffer (either from XHR for built-in dics or IndexedDB as in bug 1029951) so this is kinda a design oversight during bug 1102834. Without this bug fixed I can't progress on bug 1102835.
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8571329 [details] [review] [gaia] mnjul:bug_1138343_arraybuffer_userdict > mozilla-b2g:master Tim, This is the UserDictionary "blocker" I talked about this afternoon. Contrary to what I'd said, I now don't think this actually needs priority to be reviewed (actual code changes are quite minimal, though). I think my bug 1102835 work can continue by overlaying on this patch. Still, thanks for your time on reviewing this!
Attachment #8571329 -
Flags: review?(timdream)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jlu
Status: NEW → ASSIGNED
Whiteboard: [p=1]
Target Milestone: --- → 2.2 S7 (6mar)
Comment 3•9 years ago
|
||
Comment on attachment 8571329 [details] [review] [gaia] mnjul:bug_1138343_arraybuffer_userdict > mozilla-b2g:master I step on the same mistake once! Sorry for not caught this in the first review!
Attachment #8571329 -
Flags: review?(timdream) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Keywords: checkin-needed
Comment 4•9 years ago
|
||
Pull request has landed in master: https://github.com/mozilla-b2g/gaia/commit/bf2b7d41985f2588cb2707adeda7d695dced49bc
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•