From e873ae03967d9a58e562b083627b26f830888bdb Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Tue, 24 Nov 2020 19:41:19 +0100 Subject: [PATCH] Fix bug when error on sync --- src/notes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notes.ts b/src/notes.ts index a1be88b..8d34055 100644 --- a/src/notes.ts +++ b/src/notes.ts @@ -3,7 +3,7 @@ import { Lock, Observable } from "@hibas123/utils"; import * as aesjs from "aes-js"; import { IDBPTransaction } from "idb"; import { sha256 } from "js-sha256"; -import * as uuidv4 from "uuid/v4"; +import { v4 as uuidv4 } from "uuid"; import * as config from "../config.json"; import * as b64 from "./helper/base64"; import IDB from "./helper/indexeddb"; @@ -398,6 +398,7 @@ class NotesProvider { log(id, "DO NOTHING"); stats.do_nothing++; } + await this.oplogDB.delete(id); } catch (err) { console.error(err); stats.error++; @@ -406,7 +407,6 @@ class NotesProvider { MessageType.ERROR ); } - await this.oplogDB.delete(id); } log("Stats", stats); this.syncedObservableServer.send(