mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
8633058488
Summary: Previously, we would initialize an `AccountPool` with an account instance and reference the account as an instance variable. Then, every time we created a connection, we used the account we had a reference to obtain the credentials. However, if the credentials on the account changed, e.g. when we refresh the access token for gmail accounts, the connection pool would never realize that the account had new credentials and always try to create the connection with the old credentials, causing the sync worker to enter an error loop of `Invalid credentials` errors To fix this, we could reload the account every time we try to create a connection, but it seems that the fresh credentials should just be passed every time we create connections without the pool having to be aware of potential changes under the rug. This commit makes it so the pool no longer holds a reference to the account, but rather it is passed in every time we check out a connection Test Plan: manual. how did this even work before? :( Reviewers: evan, halla, spang, mark Reviewed By: mark Differential Revision: https://phab.nylas.com/D4370 |
||
---|---|---|
.. | ||
spec | ||
src | ||
index.js | ||
package.json | ||
README.md |
Isomorphic Core
Isomorphic refers to javascript that can be run on both the client and the server.
This is shared code for mail and utilities that is designed to run both on deployed cloud servers and from within the Nylas Mail client.
Use through a regular import: import iso-core from 'isomorphic-core'
It is required as a dependency in the package.json of other modules.
This library isn't on the npm registry, but works as a dependency thanks to
lerna bootstrap
See index.js for what gets explicitly exported by this library.
Important Usage Notes:
Since this code runs in both the client and the server, you must be careful with what libraries you use. Some common gotchas:
- You can't use
NylasEnv
orNylasExports
. These are injected only in the client. - If you require a 3rd party library, it must be added to the "dependencies" of
isomorphic-core's
package.json
- You may use modern javascript syntax. Both the client and server get compiled with the same .babelrc setting