summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/daemon/dbserver.cpp3
-rw-r--r--tests/auto/client/test-jsondb-client.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/daemon/dbserver.cpp b/src/daemon/dbserver.cpp
index d7cc336..f929ef0 100644
--- a/src/daemon/dbserver.cpp
+++ b/src/daemon/dbserver.cpp
@@ -498,7 +498,8 @@ void DBServer::objectUpdated(const QString &partitionName, quint32 stateNumber,
effectiveAction = JsonDbNotification::Create;
} else if (oldMatches && (!newMatches || object.isDeleted())) {
r = oldObject;
- r.insert(JsonDbString::kDeletedStr, true);
+ if (object.isDeleted())
+ r.insert(JsonDbString::kDeletedStr, true);
effectiveAction = JsonDbNotification::Delete;
} else if (oldMatches && newMatches) {
effectiveAction = JsonDbNotification::Update;
diff --git a/tests/auto/client/test-jsondb-client.cpp b/tests/auto/client/test-jsondb-client.cpp
index 40946c4..b316f53 100644
--- a/tests/auto/client/test-jsondb-client.cpp
+++ b/tests/auto/client/test-jsondb-client.cpp
@@ -908,6 +908,7 @@ void TestJsonDbClient::notifyUpdate()
// Update the notify-test object
// query no longer matches, so we should receive a "remove" notification even though it is an update
+ // this means it should not contain the _deleted property
object.insert("_uuid",uuid);
object.insert("_version", version);
object.insert("filter","nomatch");
@@ -918,6 +919,7 @@ void TestJsonDbClient::notifyUpdate()
n = mNotifications.takeFirst();
QCOMPARE(n.mNotifyUuid, notifyUuid);
QCOMPARE(n.mAction, QLatin1String("remove"));
+ QVERIFY(!n.mObject.toMap().contains(JsonDbString::kDeletedStr));
// Remove the notify-test object
id = mClient->remove(object);