From ac3bc48d73358d277bc9a8762919a80667008df8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Wed, 1 Feb 2023 16:18:31 +0100
Subject: [PATCH] FIX: empty string is equivalent to no name

---
 CHANGELOG.md                    | 5 +++++
 src/caoscrawler/identifiable.py | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a7fe9410..c0186b47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Removed ###
 
 ### Fixed ###
+- an empty string as name is treated as no name (as does the server). This, fixes
+  queries for identifiables since it would contain "WITH name=''" otherwise
+  which is an impossible condition. If your cfoods contained this case, it is
+  possible that Records are now matched that were not before. You need to adjust
+  your identifiable definition if this is not wanted.
 
 ### Security ###
 
diff --git a/src/caoscrawler/identifiable.py b/src/caoscrawler/identifiable.py
index 7ff71725..b793924d 100644
--- a/src/caoscrawler/identifiable.py
+++ b/src/caoscrawler/identifiable.py
@@ -62,6 +62,8 @@ class Identifiable():
         self.path = path
         self.record_type = record_type
         self.name = name
+        if name is "":
+            self.name = None
         self.properties: dict = {}
         if properties is not None:
             self.properties = properties
-- 
GitLab