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

iOS: Fixes #10396: Fix Dropbox sync for large file collections #10411

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented May 8, 2024

Summary

This pull request might resolve #10396. It adjusts the original workaround added in #10400 to be more efficient when there are many files on the sync target.

See also:

Notes

  • Users on the forum are reporting a different "lock has expired" error that does not match the errors I've experienced while testing locally.
    • So far, local tests have been done with a small number of notes/notebooks.
  • In Mobile: Fixes #10396: Fix Dropbox sync #10400, I assumed that this.list() would be fast for a large number of remote files, only returning the first page of results. Although the Dropbox API used by list() is paginated, list() sends a request for each page.
  • In my (very limited) tests, the sync workaround is triggered about once per sync.
  • Unrelated errors trigger the workaround.
    • One option would be to check for a "Network request failed" error message. However, if Dropbox and/or iOS changes such that the error message becomes more descriptive, this could break our sync logic in the future. To-test: Is the error message localized?

Testing plan

  1. Set up Dropbox sync.
  2. Create a note.
  3. Sync.
  4. Verify that sync completes successfully.
  5. Make copies of/duplicate notes until the "Sync status" screen shows roughly 100 items.
  6. Sync.

Note

This has not yet been tested with a larger collection of notes.

@personalizedrefrigerator
Copy link
Collaborator Author

While testing this PR with a larger number of items, I'm getting 503 errors (37 such errors for 59 fetched items):

Request to files/download failed. Retrying with workaround. Error:  [Error: GET files/download: Error (503): <!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dropbox - 503</title>
<link href="https://cfl.dropboxstatic.com/static/metaserver/static/css/error.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="https://cfl.dropboxstatic.com/static/images/favicon.ico"/>
</head>
<body>
<div class="figure">
<img src="https://assets.dropbox.com/www/en-us/illustrations/spot/target-miss.svg" alt="Error: 503"/>
</div>
<div id="errorbox">
<h1>Error (503)</h1>Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our <a href="https://status.dropbox.com">Status Page</a> to see if there is a known incident, our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
</div>

</body>
</html>
]

This message is coming from the logger.warn in the catch block just before starting the workaround for the original issue.

@laurent22 laurent22 merged commit 3042e61 into laurent22:release-2.14 May 8, 2024
10 checks passed
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.

2 participants