Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/local: Don't retry moving locked docs (#2018)
On Windows, files and folders can be locked by software. These locks result in `EPERM`, `EBUSY` or `EACCES` errors when trying to modify or move the documents (and sometimes their parent folders). For example, Anti-Virus software can block a folder for up to a minute and for this reason `graceful-fs`, the drop-in replacement for Node's `fs` module used by our own dependency `fs-extra` adds a retry mechanism to the `rename` method in case the returned error is `EPERM` or `EACCES`. See https://github.com/isaacs/node-graceful-fs/blob/1139b6f1e255aeddbf2abd1380a359792d8ea91a/polyfills.js#L83 Now that we're blocking the synchronization on local filesystem permission errors, this comes at odds with our own retry mechanism and delays the result of our retries for a full minute during which we display a "synchronizing" state to the user. We probably don't need the retry mechanism from `graceful-fs` anymore so we use the `fs` module directly when making `rename` calls. If this change proves to be more inconvenient than useful, we can always revisit this decision.
- Loading branch information