From 9cd8cbf42c07ffa2da69e7633b40b69bc8d22489 Mon Sep 17 00:00:00 2001 From: Cyber Gsus Date: Thu, 10 Jun 2021 12:36:15 +0200 Subject: [PATCH] added some notes --- src/js/core/read_write_proxy.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/core/read_write_proxy.js b/src/js/core/read_write_proxy.js index c1a51df9..2f1b8f1e 100644 --- a/src/js/core/read_write_proxy.js +++ b/src/js/core/read_write_proxy.js @@ -380,6 +380,15 @@ export class ReadWriteProxy { /** @returns {ExplainedResult} */ internalVerifyEntry(data) { + // NOTE: this check could be removed if it's only used in `readAsync`, + // as the data HAS to be migrated. Probably with a sanity check at `readAsync` + // to check that migration did set the version flag accordingly, i.e + // ```js + // if (contents.version < currentVersion) { + // // .. migrate contents and check result + // if (contents.version !== currentVersion) return Prmoise.reject(`Version mismatch after migration: ...`); + // } + // ``` if (data.version !== this.getCurrentVersion()) { return ExplainedResult.bad( "Version mismatch, got " + data.version + " and expected " + this.getCurrentVersion()