mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-31 12:30:14 +08:00
3dccb374b3
NylasLongConnection ends the connection when the 'end' event is emitted by the `request` object. When this happens, the global connection buffer is cleared. Also, the global buffer holds the data we've received from the connection, and whenever we receive new data, we accumulate it in the buffer and call a processBuffer function which is throttled to 400ms. Given that the buffer is global state, and processing occurs asynchronously with a delay of up to 400ms, if the 'end' event on the connection is fired before we actually get to process the buffer, we would clear it and show no results. This scenario currently only affected search because if we accidentally threw away some data when streaming deltas, we will get that data again when we reopen the delta streaming connection. |
||
---|---|---|
.. | ||
contact-rankings-cache.coffee | ||
delta-streaming-connection.es6 | ||
main.coffee | ||
nylas-sync-worker-pool.coffee | ||
nylas-sync-worker.coffee | ||
refreshing-json-cache.coffee |