mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
fix(transaction): Trigger changes only after COMMIT has been executed
- Fixes #1327 - This caused the dataase query inside QuerySubscription to, on occassion, return stale results from the database because the database hadn't finished writing. This consequently caused the QuerySubscription to build and incorrect result set.
This commit is contained in:
parent
199a62d70e
commit
703d7bc2e0
|
@ -27,11 +27,11 @@ class DatabaseTransaction
|
|||
fn(@)
|
||||
.finally =>
|
||||
if @_opened
|
||||
@_query("COMMIT")
|
||||
@_opened = false
|
||||
global.setImmediate =>
|
||||
for record in @_changeRecords
|
||||
@database.accumulateAndTrigger(record)
|
||||
@_query("COMMIT")
|
||||
.then =>
|
||||
for record in @_changeRecords
|
||||
@database.accumulateAndTrigger(record)
|
||||
|
||||
# Mutating the Database
|
||||
|
||||
|
|
Loading…
Reference in a new issue