Skip to content

fix(datastore): Accept applicable data if errors are present when syncing #2278

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

Merged
merged 18 commits into from
Mar 15, 2023

Conversation

manueliglesias
Copy link
Contributor

@manueliglesias manueliglesias commented Feb 7, 2023

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:
N/A

Description of changes:
- Do not prevent AppSyncClient from invoking onResponse if GraphQL errors are present in the response.
- Make SyncProcessor's syncPage emit applicable data and log a warning if GraphQL errors were present too.
- Make PaginatedResult filter out null items
- Add Hub event for nonApplicableDataReceived
- Call errorHandler and send Hub event

How did you test these changes?
Manual and unit testing.
For manual testing, I went to my DynamoDB table and edited some items to remove required fields, then I cleared/started datastore to force base sync queries to happen. I verified that log messages were present in the logcat, that my custom errorHandler was invoked with the right exception and that the Hub events where emitted. I was able to query for all the applicable data and DataStore was still working as normal.

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.

@manueliglesias manueliglesias marked this pull request as ready for review February 7, 2023 03:03
@manueliglesias manueliglesias requested review from a team as code owners February 7, 2023 03:03
mattcreaser
mattcreaser previously approved these changes Feb 7, 2023
…sync query.

- Do not prevent AppSyncClient from invoking onResponse if GraphQL errors are present in the response.
- Make SyncProcessor's syncPage emit applicable data and log a warning if GraphQL errors were present too.
- Make PaginatedResult filter out null items
@manueliglesias manueliglesias force-pushed the manuelig/applicable-data branch from 7cfdc32 to edaa8f7 Compare February 9, 2023 05:16
div5yesh
div5yesh previously approved these changes Feb 28, 2023
@div5yesh div5yesh enabled auto-merge (squash) March 8, 2023 19:06
@div5yesh div5yesh merged commit 823c558 into main Mar 15, 2023
@div5yesh div5yesh deleted the manuelig/applicable-data branch March 15, 2023 20:43
gpanshu pushed a commit that referenced this pull request Apr 28, 2023
…cing (#2278)

Signed-off-by: Manuel Iglesias <[email protected]>
Co-authored-by: Divyesh Chitroda <[email protected]>
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.

3 participants