Skip to content

fix(android/engine): Handle parsing empty JSONArray as JSONObject#7611

Merged
darcywong00 merged 2 commits intobetafrom
fix/android/json-obj-parser
Nov 3, 2022
Merged

fix(android/engine): Handle parsing empty JSONArray as JSONObject#7611
darcywong00 merged 2 commits intobetafrom
fix/android/json-obj-parser

Conversation

@darcywong00
Copy link
Contributor

Fixes #7564
I'm not sure the circumstances, but from the Sentry logs it appears there's times the Cloud catalog queries return [] and the Keyman Engine JSON parsing code throws an exception treating it as a JSONObject.

This updates the JSON parser to treat [] as an empty JSON Object.

@keymanapp-test-bot skip

@darcywong00 darcywong00 requested a review from mcdurdin as a code owner November 3, 2022 02:46
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Nov 3, 2022

User Test Results

Test specification and instructions

User tests are not required

….java

Co-authored-by: Marc Durdin <marc@durdin.net>
@darcywong00 darcywong00 merged commit ad58fa7 into beta Nov 3, 2022
@darcywong00 darcywong00 deleted the fix/android/json-obj-parser branch November 3, 2022 04:06
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 16.0.96-beta

@sentry
Copy link

sentry bot commented Nov 22, 2022

Sentry issue: KEYMAN-ANDROID-PB

@mcdurdin
Copy link
Member

I'm not sure the circumstances, but from the Sentry logs it appears there's times the Cloud catalog queries return [] and the Keyman Engine JSON parsing code throws an exception treating it as a JSONObject.

I think I'd like to verify the root cause of this on api.keyman.com as well -- and make sure that there are not circumstances where this is happening, wrongly.

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.

bug(android/engine): JSONException: Value [] of type org.json.JSONArray cannot be converted to JSONObject

3 participants