From 66f582a25831db424447205ec778c6e78588d797 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Mon, 26 Feb 2024 16:54:27 +0530 Subject: [PATCH 1/2] avniproject/avni-client#1309 - manage compaction using shouldCompact logic --- src/Schema.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Schema.js b/src/Schema.js index f5ce142..2657f0b 100644 --- a/src/Schema.js +++ b/src/Schema.js @@ -327,6 +327,11 @@ function migrateAllEmbeddedForTxnData(oldDB, newDB) { function createRealmConfig() { return { + shouldCompact: function (totalBytes, usedBytes) { + const doCompact = (totalBytes / usedBytes) > 1.1; + console.log("Should compact", totalBytes, usedBytes, doCompact); + return doCompact; + }, //order is important, should be arranged according to the dependency schemaVersion: 185, onMigration: function (oldDB, newDB) { From 068dc825518452d6802801ffb8a8ee0899bdca59 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Mon, 26 Feb 2024 16:54:59 +0530 Subject: [PATCH 2/2] v1.31.41 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0c6b3e..c276b88 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "openchs-models", "description": "OpenCHS data model to be used by front end clients", - "version": "1.31.39", + "version": "1.31.41", "private": false, "repository": { "type": "git",