mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-13 21:24:58 +08:00
47f57a6c02
Summary: Previously if we got back a huge number of unknown UIDs from IMAP search we would try to sync all of them at once. This could lead to hanging the sync loop trying to download tons of messages. This diff limits the UIDs we're willing to sync per task to 500 and splits each task up into chunks of 25 messages so that we don't try to download all of them at once. If we need to sync more than 500 uids then at the end of the syncback task it will queue another task to run the next time the sync loop rolls back around. Test Plan: Run locally, verify that we gracefully handle various situations including cancelling during the syncback task, cancelling between syncback tasks, huge numbers of results, etc Reviewers: evan, spang, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4142 |
||
---|---|---|
.. | ||
images | ||
spec | ||
src | ||
stylesheets | ||
main.es6 | ||
package.json | ||
README.md |
Client Sync
This is the mail sync engine that runs within the Nylas Mail client
It is symlinked in as an internal_package
of Nylas Mail via the postinstall
script of the root repo.
Important Usage Notes:
Since this is symlinked in as an internal_package
of Nylas Mail, there are a
handulf of considerations when developing in client-sync. Some common gotchas:
- You MAY use
NylasEnv
,NylasExports
and other injected libraries in the Nylas Mail client environment. - You MAY use any 3rd party library declared in
client-app/package.json
. Since this gets added as a plugin of the Nylas Mail client, you'll have access to all libraries. This works because theclient-app/node_modules
was added to the global require paths. That lets us access client-app plugins without being a file directory decendent of client-app (client-sync is now a sibling of client-app) - You may NOT add "dependencies" to the
client-sync/package.json
. If you need a 3rd party library, add it to the mainclient-app/package.json
. All Nylas Mail plugins (those inside ofinternal_packages
), may no longer declare their own dependencies. - You should be aggressive at moving generic mail methods to
isomorphic-core
. We may eventually want to make large chunks of client-sync work in a cloud environment as well.