Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Add an extra check on transactions status update

Hakan Shehuc6858c8c7431
diff --git a/apps/desktop/src/main/services/sync-service.ts b/apps/desktop/src/main/services/sync-service.ts
index 3d05417b..af38bd13 100644
--- a/apps/desktop/src/main/services/sync-service.ts
+++ b/apps/desktop/src/main/services/sync-service.ts
@@ -210,6 +210,7 @@ class SyncService {
.updateTable('node_transactions')
.set({ status: 'sent' })
.where('id', 'in', syncedTransactionIds)
+ .where('status', '=', 'pending')
.execute();
}
@@ -218,6 +219,7 @@ class SyncService {
.updateTable('node_transactions')
.set((eb) => ({ retry_count: eb('retry_count', '+', 1) }))
.where('id', 'in', unsyncedTransactionIds)
+ .where('status', '=', 'pending')
.execute();
}
}