Skip to content
Snippets Groups Projects
Commit 33d9a47f authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1322 `sync`: chained transactions generate make the sync fail

parent cfc6c9d7
Branches
Tags
No related merge requests found
...@@ -169,8 +169,14 @@ export class QuickSynchronizer { ...@@ -169,8 +169,14 @@ export class QuickSynchronizer {
// Fills in correctly the SINDEX // Fills in correctly the SINDEX
await Promise.all(_.where(sync_sindex.concat(local_sindex), { op: 'UPDATE' }).map(async (entry: any) => { await Promise.all(_.where(sync_sindex.concat(local_sindex), { op: 'UPDATE' }).map(async (entry: any) => {
if (!entry.conditions) { if (!entry.conditions) {
const src = await this.dal.sindexDAL.getSource(entry.identifier, entry.pos); if (entry.srcType === 'D') {
entry.conditions = src.conditions; entry.conditions = 'SIG(' + entry.identifier + ')'
} else {
// First: have a look locally, but only chained transactions would have `localSrc` matching (giving conditions)
const localSrc = local_sindex.filter(s => s.identifier === entry.identifier && s.pos === entry.pos && s.conditions)[0]
const src = localSrc || (await this.dal.getSource(entry.identifier, entry.pos, false))
entry.conditions = src.conditions
}
} }
})) }))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment