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

Hubdb function downloadHubDbTable incorrectly download table rows #381

Closed
darkmavis1980 opened this issue Nov 9, 2020 · 1 comment · Fixed by #384
Closed

Hubdb function downloadHubDbTable incorrectly download table rows #381

darkmavis1980 opened this issue Nov 9, 2020 · 1 comment · Fixed by #384
Assignees

Comments

@darkmavis1980
Copy link

darkmavis1980 commented Nov 9, 2020

Description and Context

I just found out an issue with the downloadHubDbTable in the packages/cms-lib/hubdb.js file in the cms-lib package.
So essentially while in the API v2 implementation we used to fetch table rows using limit and offset parameters to fetch large tables, now in the new version v3 you must pass the limit and after params, where the after is a pointer to the next set of records and not just a number as the offset.
This cause an issue with the downloadHubDbTable where if you have 1001 records, the downloaded table will have 2000 records as it downloads the first 1000 twice.

I'm using the latest version of the cms-cli 2.1.1-beta.10

Steps to reproduce

Use the downloadHubDbTable method to download a table with more than 1000 rows, once downloaded open the file and you should have the first 1000 rows repeated as per many times the total rows of the table divided by 1000 (so if you have 2020 rows, you will get 3000 rows).

Expected behavior

It should download all the rows on a file.

Who to Notify

@drewjenkins @anthmatic

@drewjenkins drewjenkins self-assigned this Nov 9, 2020
drewjenkins added a commit that referenced this issue Nov 9, 2020
drewjenkins added a commit that referenced this issue Nov 10, 2020
Fix for #381 - downloadHubDbTable would download incorrect results for large tables
@darkmavis1980
Copy link
Author

Thanks @drewjenkins 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants