Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppSyncCustomNetworkInvoker JSON parse error when data is null due to mutation validation errors on server #292

Closed
pthomascelltrak opened this issue Jun 11, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@pthomascelltrak
Copy link

Referenced line assumes that there will always be a data object returned for a mutation. This is not true when validation fails - only the errors field is set. This should probably use optJSONObject.

@TrekSoft TrekSoft added AppSync bug Something isn't working labels Jun 16, 2020
@doc-rj-celltrak
Copy link

doc-rj-celltrak commented Jan 5, 2021

This bug prevents us from learning that an offline mutation eventually fails, unlike iOS. It's only a one-line fix. I hope you can prioritize it. Thanks!

@doc-rj-celltrak
Copy link

doc-rj-celltrak commented Feb 8, 2021

Is there a chance you can address this issue? We believe it's a one-line fix, and it will un-block us. Thanks, we appreciate your help in advance.

@doc-rj-celltrak
Copy link

doc-rj-celltrak commented Feb 8, 2021

To be clear, the fix is to replace this line:

persistentMutationsCallback.onResponse(new PersistentMutationsResponse(
    jsonObject.getJSONObject("data"), // ...

with this:

persistentMutationsCallback.onResponse(new PersistentMutationsResponse(
    jsonObject.optJSONObject("data"), // ...

@jamesonwilliams
Copy link
Contributor

@doc-rj-celltrak thanks, looks reasonable. Our on-call engineer is having a look.

@changxu0306
Copy link
Contributor

@doc-rj-celltrak Thanks for your suggestion. We've merged the fixing PR. Will do a release this week.

@doc-rj-celltrak
Copy link

Great, thanks @changxu0306 and @jamesonwilliams

@eeatonaws
Copy link
Contributor

A PR with the fix for this issue was released as part of version 3.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants