mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-16 13:11:50 +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
fe7a894e51
commit
0f2249ffa7
1 changed files with 4 additions and 4 deletions
|
@ -27,11 +27,11 @@ class DatabaseTransaction
|
||||||
fn(@)
|
fn(@)
|
||||||
.finally =>
|
.finally =>
|
||||||
if @_opened
|
if @_opened
|
||||||
@_query("COMMIT")
|
|
||||||
@_opened = false
|
@_opened = false
|
||||||
global.setImmediate =>
|
@_query("COMMIT")
|
||||||
for record in @_changeRecords
|
.then =>
|
||||||
@database.accumulateAndTrigger(record)
|
for record in @_changeRecords
|
||||||
|
@database.accumulateAndTrigger(record)
|
||||||
|
|
||||||
# Mutating the Database
|
# Mutating the Database
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue