mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
Fix version id condition
This commit is contained in:
@@ -194,7 +194,7 @@ const handleUpdateNodeChange = async (
|
||||
while (count++ < 10) {
|
||||
const existingNode = await database
|
||||
.selectFrom('nodes')
|
||||
.select(['id', 'workspace_id', 'attributes', 'state'])
|
||||
.select(['id', 'workspace_id', 'attributes', 'state', 'version_id'])
|
||||
.where('id', '=', changeData.id)
|
||||
.executeTakeFirst();
|
||||
|
||||
@@ -240,7 +240,7 @@ const handleUpdateNodeChange = async (
|
||||
server_updated_at: new Date(),
|
||||
})
|
||||
.where('id', '=', changeData.id)
|
||||
.where('version_id', '=', changeData.versionId)
|
||||
.where('version_id', '=', existingNode.version_id)
|
||||
.execute();
|
||||
|
||||
if (hasUpdateChanges(result)) {
|
||||
|
||||
Reference in New Issue
Block a user