{"push_id":681406196,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"400381b84a253e55377a8706f0fd7dad72d4c9f3","before":"2652c475aeac24ba01763c6d2de09583c24dc652","commits":[{"sha":"400381b84a253e55377a8706f0fd7dad72d4c9f3","author":{"email":"d1abc94d70526bfcf3e4b0ce727cb9a6fbb52a3a@inboxapp.com","name":"Eben Freeman"},"message":"Rework IMAP connection handling\n\nSummary:\n* geventconnpool has a rather serious flaw in which uncaught exceptions raised\n  when creating a new connection can silently deplete the pool, causing\n  deadlock. Instead, use a simple queue to safely manage connections.\n  Connections are now instantiated lazily and synchronously. This means that if\n  no connection is available, a call to CrispinConnectionPool.get() will\n  instantiate a new connection in the calling greenlet's. So any exceptions can\n  be appropriately handled by the caller instead of vanishing into the void.\n\n* Remove unnecessary token validation step when renewing OAuth access tokens.\n  You only need to validate tokens if you're doing client-side/implicit OAuth.\n\n* Improve 'invalid' state handling for OAuth accounts. For these accounts, the\n  right way to tell that the user has revoked access is to inspect the error\n  returned when renewing an access token. IMAP login errors should never\n  translate to \"invalid credentials\" for OAuth accounts. This could cause OAuth\n  accounts to be wrongly marked invalid.\n\n* Simplify error handling on connection instantiation and login. Remove the\n  dubious distinction between `ConnectionError` and `TransientConnectionError`.\n  Instead of keeping a list of IMAP LOGIN error responses which we consider\n  transient, keep a list of error responses which we consider permanent. That\n  way if we get some unfamiliar error response, we'll at least keep trying.\n\n* Don't set account-level \"connerror\" state.\n\nFixes Github issues #141 and #123.\n\nTest Plan:\nUnit tests for pooling behavior added. Sync tested with a variety of\nproviders for both normal sync and invalid credential handling. Could still use\nmore unit tests for code not previously covered.\n\nReviewers: spang, khamidou\n\nReviewed By: khamidou\n\nDifferential Revision: https://phab.nylas.com/D1573","distinct":true,"url":"https://api.github.com/repos/nylas/sync-engine/commits/400381b84a253e55377a8706f0fd7dad72d4c9f3"}]}