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

Google Drive only retrieves 100 most recent brews #1943

Closed
calculuschild opened this issue Jan 4, 2022 · 4 comments · Fixed by #1944
Closed

Google Drive only retrieves 100 most recent brews #1943

calculuschild opened this issue Jan 4, 2022 · 4 comments · Fixed by #1944
Assignees
Labels
bug We say this works but it doesn't P0 - security or data loss Possible damage to server, users, or data

Comments

@calculuschild
Copy link
Member

We have users with surprisingly more than 100 brews on Google Drive, and they can only see the most recent 100 in their user page, which gives people a scare about lost data. Should be a pretty simple tweak to change the max number of files Google retrieves at once.

See https://www.reddit.com/r/homebrewery/comments/rv7unz/issue_my_brews_continuously_disappear_off_my_page/hr91fs2/?context=3

@calculuschild calculuschild added bug We say this works but it doesn't P0 - security or data loss Possible damage to server, users, or data labels Jan 4, 2022
@G-Ambatte
Copy link
Collaborator

G-Ambatte commented Jan 4, 2022

The 100 file limit appears to be set here.

Reading through the Google Drive API documentation, it appears that this is the default value for pageSize. However, from the API documentation, the value can be increased to a maximum value of 1000.

Remediation options:

  1. Increase pageSize to 1000. This will alleviate the immediate issue, but may make fetching large numbers of Google files take a long time. The issue will return if/when users have more than 1000 Google brews.

  2. Develop and implement a paging system for the UserPage, based on the value of nextPageToken. If this token exists, there are more Google brews to be retrieved than could fit in the current pageSize.


My current thinking is that we should implement solution 1 immediately - it is literally adding a single 0 to one line of googleActions.js - to alleviate the issue for affected users, and add solution 2 to the roadmap as the permanent solution.

@calculuschild
Copy link
Member Author

For future reference, there may be some nuance with what pageSize actually means: it is a "maximum" rather than an absolute value, so it is possible that Google has a hiccup and stops before getting the complete set of pageSize, and using nextPageToken may be necessary at a certain point. If that issue comes up we can implement more a more involved solution.

The docs:

The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. Acceptable values are 1 to 1000, inclusive. (Default: 100)

Stackoverflow:
https://stackoverflow.com/questions/42592125/list-request-page-size-being-ignored

Google API Github
googleapis/google-api-nodejs-client#722

@G-Ambatte
Copy link
Collaborator

From the documentation, incompleteSearch will be set to true if the search did not complete. I think we could implement a looping function if nextPageToken and throw a warning on incompleteSearch.

@ericscheid
Copy link
Collaborator

My current thinking is that we should implement solution 1 immediately - it is literally adding a single 0 to one line of googleActions.js - to alleviate the issue for affected users, and add solution 2 to the roadmap as the permanent solution

This issue has indeed risen again — see #2408.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We say this works but it doesn't P0 - security or data loss Possible damage to server, users, or data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants