Фикс бага с уникальными индексами сообщений

This commit is contained in:
RoyceDa
2026-02-16 19:28:36 +02:00
parent d02cb63ffe
commit 432b270b34
4 changed files with 17 additions and 7 deletions

View File

@@ -70,8 +70,8 @@ export function useDialogFiber() {
}
await runQuery(
"INSERT INTO accounts_sync_times (account, last_sync) VALUES (?, ?) " +
"ON CONFLICT(account) DO UPDATE SET last_sync = ?",
[publicKey, timestamp, timestamp]
"ON CONFLICT(account) DO UPDATE SET last_sync = ? WHERE account = ?",
[publicKey, timestamp, timestamp, publicKey]
);
};

View File

@@ -54,8 +54,8 @@ export function useSynchronize() {
console.info("Batch finished");
await runQuery(
"INSERT INTO accounts_sync_times (account, last_sync) VALUES (?, ?) " +
"ON CONFLICT(account) DO UPDATE SET last_sync = ?",
[publicKey, packet.getTimestamp(), packet.getTimestamp()]
"ON CONFLICT(account) DO UPDATE SET last_sync = ? WHERE account = ?",
[publicKey, packet.getTimestamp(), packet.getTimestamp(), publicKey]
);
console.info("Batch complete", publicKey, packet.getTimestamp());
trySync();