Fix bug when error on sync

This commit is contained in:
Fabian Stamm 2020-11-24 19:41:19 +01:00
parent 3c80ac3125
commit e873ae0396

View File

@ -3,7 +3,7 @@ import { Lock, Observable } from "@hibas123/utils";
import * as aesjs from "aes-js"; import * as aesjs from "aes-js";
import { IDBPTransaction } from "idb"; import { IDBPTransaction } from "idb";
import { sha256 } from "js-sha256"; 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 config from "../config.json";
import * as b64 from "./helper/base64"; import * as b64 from "./helper/base64";
import IDB from "./helper/indexeddb"; import IDB from "./helper/indexeddb";
@ -398,6 +398,7 @@ class NotesProvider {
log(id, "DO NOTHING"); log(id, "DO NOTHING");
stats.do_nothing++; stats.do_nothing++;
} }
await this.oplogDB.delete(id);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
stats.error++; stats.error++;
@ -406,7 +407,6 @@ class NotesProvider {
MessageType.ERROR MessageType.ERROR
); );
} }
await this.oplogDB.delete(id);
} }
log("Stats", stats); log("Stats", stats);
this.syncedObservableServer.send( this.syncedObservableServer.send(