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

fix(flutter/datastore): Nullable custom type arrays #2565

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

dnys1
Copy link
Contributor

@dnys1 dnys1 commented Aug 18, 2023

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

aws-amplify/amplify-flutter#3575

Description of changes:

When a custom type array is not required and null is returned from AppSync, deserialization will fail since getAsJsonArray will throw for null values.

This resolves the issue by checking if a field is null before attempting deserialization.

How did you test these changes?

Added test case for null custom type array.

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dnys1 dnys1 requested a review from a team as a code owner August 18, 2023 15:38
Fixes aws-amplify/amplify-flutter#3575. When a custom type array is not required and `null` is returned from AppSync, deserialization will fail since `getAsJsonArray` will throw for `null` values.

This resolves the issue by checking if a field is `null` before attempting deserialization.
@dnys1 dnys1 force-pushed the fix/datastore/nullable-custom-arrays branch from 61273fa to cd0025e Compare August 18, 2023 16:52
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2023

Codecov Report

Merging #2565 (14f500b) into main (07c0de3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main    #2565      +/-   ##
==========================================
+ Coverage   41.43%   41.44%   +0.01%     
==========================================
  Files         874      874              
  Lines       27644    27648       +4     
  Branches     3883     3884       +1     
==========================================
+ Hits        11455    11460       +5     
- Misses      14960    14961       +1     
+ Partials     1229     1227       -2     

@gpanshu gpanshu self-requested a review August 21, 2023 15:13
@gpanshu gpanshu enabled auto-merge (squash) August 23, 2023 15:12
@gpanshu gpanshu merged commit 9653171 into main Aug 23, 2023
3 of 4 checks passed
@gpanshu gpanshu deleted the fix/datastore/nullable-custom-arrays branch August 23, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants