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

feat(@aws-amplify/datastore): configurable sync pagination limit #5181

Merged
merged 5 commits into from
Mar 27, 2020

Conversation

polymath-shpetim
Copy link
Contributor

@polymath-shpetim polymath-shpetim commented Mar 24, 2020

Allow user to configure sync pagination limit due to limit reach of 1MB if dynamodb documents are bigger. By reducing pagination limit it's possible to overcome following issue:

{
  "data": {
    "syncDocuments": null
  },
  "errors": [
    {
      "path": [
        "syncDocuments"
      ],
      "data": null,
      "errorType": "MappingTemplate",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 5,
          "sourceName": null
        }
      ],
      "message": "Transformation too large"
    }
  ]
}

This pull request allow users to add such configuration as following:

DataStore.configure({
    syncPageSize: number
})

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

@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #5181 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5181      +/-   ##
==========================================
- Coverage   73.22%   73.17%   -0.05%     
==========================================
  Files         193      193              
  Lines       11442    11449       +7     
  Branches     2302     2221      -81     
==========================================
  Hits         8378     8378              
- Misses       2900     2923      +23     
+ Partials      164      148      -16     
Impacted Files Coverage Δ
packages/datastore/src/datastore/datastore.ts 70.15% <0.00%> (-0.66%) ⬇️
packages/datastore/src/sync/index.ts 15.34% <0.00%> (-0.09%) ⬇️
packages/datastore/src/sync/processors/sync.ts 17.33% <0.00%> (-0.73%) ⬇️
packages/datastore/src/types.ts 83.92% <ø> (ø)
packages/auth/src/OAuth/OAuth.ts 48.12% <0.00%> (ø)
packages/datastore/src/sync/outbox.ts 25.00% <0.00%> (ø)
packages/datastore/src/storage/storage.ts 67.59% <0.00%> (ø)
packages/core/src/OAuthHelper/GoogleOAuth.ts 31.25% <0.00%> (ø)
packages/xr/src/Providers/SumerianProvider.ts 47.55% <0.00%> (ø)
packages/core/src/OAuthHelper/FacebookOAuth.ts 34.09% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9c020d...42501e2. Read the comment docs.

@manueliglesias manueliglesias self-assigned this Mar 25, 2020
Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the contribution @polymath-shpetim , it looks great 😄

I do have one change request though, can you rename paginationLimit to syncPageSize ?

@polymath-shpetim
Copy link
Contributor Author

Thank you so much for the contribution @polymath-shpetim , it looks great 😄

I do have one change request though, can you rename paginationLimit to syncPageSize ?

Updated code, thanks for feedback.

Cheers

Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! thanks! 👍

@manueliglesias manueliglesias merged commit a4f518b into aws-amplify:master Mar 27, 2020
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants