From a18f6dbe343163fd14754e3fff206373caa164e8 Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Fri, 15 Dec 2023 09:07:22 +0100 Subject: [PATCH] [resoto][fix] Change node should also reflect ancestors in self (#1859) --- resotocore/resotocore/db/graphdb.py | 2 +- resotocore/tests/resotocore/db/graphdb_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resotocore/resotocore/db/graphdb.py b/resotocore/resotocore/db/graphdb.py index c913bd72ba..094a85c077 100644 --- a/resotocore/resotocore/db/graphdb.py +++ b/resotocore/resotocore/db/graphdb.py @@ -1493,7 +1493,7 @@ def update_resolved( coll = self.node_history if history else self.vertex_name return dedent( f""" - FOR d in `{coll}` FILTER d._key!=@node_id and d.{prop.to}==@node_id + FOR d in `{coll}` FILTER d.{prop.to}==@node_id UPDATE d WITH @patch in `{coll}` COLLECT WITH COUNT INTO count RETURN count diff --git a/resotocore/tests/resotocore/db/graphdb_test.py b/resotocore/tests/resotocore/db/graphdb_test.py index eab5a9c029..9a9bf61c0b 100644 --- a/resotocore/tests/resotocore/db/graphdb_test.py +++ b/resotocore/tests/resotocore/db/graphdb_test.py @@ -534,8 +534,8 @@ async def elements(history: bool) -> List[Json]: async with await fn(query=model) as crs: # type: ignore return [e async for e in crs] - assert len(await elements(False)) == 110 - assert len(await elements(True)) == 111 # history includes the node itself + assert len(await elements(False)) == 111 + assert len(await elements(True)) == 111 @mark.asyncio