From bfea7119217a766f7b3e02100ac697dc4317ceb3 Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Mon, 11 May 2020 11:11:20 +0200 Subject: [PATCH] make sure to mark entry as dirty when deleting binary. --- lib/src/kdbx_entry.dart | 1 + test/kdbx_binaries_test.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/src/kdbx_entry.dart b/lib/src/kdbx_entry.dart index c61080a..fb769f7 100644 --- a/lib/src/kdbx_entry.dart +++ b/lib/src/kdbx_entry.dart @@ -229,6 +229,7 @@ class KdbxEntry extends KdbxObject { if (!binary.isInline) { file.ctx.removeBinary(binary); } + isDirty = true; } KdbxKey _uniqueBinaryName(String fileName) { diff --git a/test/kdbx_binaries_test.dart b/test/kdbx_binaries_test.dart index 7f11692..6b60ef1 100644 --- a/test/kdbx_binaries_test.dart +++ b/test/kdbx_binaries_test.dart @@ -140,6 +140,7 @@ void main() { expect(file.ctx.binariesIterable, hasLength(2)); entry.removeBinary(KdbxKey('example2.txt')); expect(file.ctx.binariesIterable, hasLength(1)); + expect(file.dirtyObjects, [entry]); return await file.save(); })(); final file = await TestUtil.readKdbxFileBytes(saved);