mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 18:44:01 +08:00
[isomorphic-core] don't try and inflate delete deltas
Summary: If we inflate delete deltas, the object we're trying to find won't exist anymore (we just deleted it!). This is likely causing the `While inflating ${sourceName} transactions, we couldn't find models for some ${modelName} IDs` error. Fixes T7436 Test Plan: manual Reviewers: spang, juan, halla Reviewed By: halla Maniphest Tasks: T7436 Differential Revision: https://phab.nylas.com/D3621
This commit is contained in:
parent
ac08163c51
commit
b03c0c9bc2
1 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,10 @@ const stream = require('stream');
|
|||
* the inflated model they reference.
|
||||
*/
|
||||
function inflateTransactions(db, accountId, transactions = [], sourceName) {
|
||||
const transactionJSONs = transactions.map((t) => (t.toJSON ? t.toJSON() : t))
|
||||
const transactionJSONs = transactions
|
||||
.filter((t) => t.event !== 'delete')
|
||||
.map((t) => (t.toJSON ? t.toJSON() : t))
|
||||
|
||||
transactionJSONs.forEach((t) => {
|
||||
t.cursor = t.id;
|
||||
t.accountId = accountId;
|
||||
|
|
Loading…
Reference in a new issue