mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 18:47:51 +08:00
[client-sync] fix unbouded query
Summary: Fixes T7783 This unbounded query, plus a yet-to-be-diagnosed bug causing large numbers of messages with no folderIds, led to frequent crashes of the worker window at the end of every sync loop. This took a fair amount to diagnose. Notes on that are here: https://paper.dropbox.com/doc/Diagnosing-Crash-X329VTxevrqtIMESBtHNV Huge thanks to @mark. Test Plan: Reboot app with patch, no more crashes! Reviewers: spang, halla, mark, juan Reviewed By: mark, juan Subscribers: mark Maniphest Tasks: T7783 Differential Revision: https://phab.nylas.com/D4039
This commit is contained in:
parent
15eac9c9db
commit
c7bdb5804a
1 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,8 @@ class SyncWorker {
|
|||
const {Message, Thread, Folder, Label} = this._db;
|
||||
|
||||
const messagesWithoutFolder = await Message.findAll({
|
||||
attributes: ['id', 'threadId'],
|
||||
limit: 1000,
|
||||
where: {
|
||||
folderId: null,
|
||||
isSent: {$not: true},
|
||||
|
@ -116,6 +118,8 @@ class SyncWorker {
|
|||
})
|
||||
.map(syncbackRequest => syncbackRequest.props.messageId)
|
||||
const messagesWithoutImapUID = await Message.findAll({
|
||||
attributes: ['id', 'threadId'],
|
||||
limit: 1000,
|
||||
where: {
|
||||
folderImapUID: null,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue