Entities with names differing only in case are allowed; causes errors later #2754
Labels
No labels
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2754
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If I try to create two entities with the same name, eg "Test Case Insensitive Duplicate", the second one has
[2]
appended to its name. But if I create an entity with name "test case insensitive duplicate", its name is not deduplicated. Later, trying to edit annotations for this entity will crash inEntity.get_by_name
with:(wrapped for clarity).
Even if this is fixed (untested patch to follow) to forbid you creating entities whose names differ only in case, I think there's still a problem if one entity has name Foo, and another entity has additionalName Foo: nothing guards against this situation, but it will break
Entity.get_by_name
in the same way.Attachment 0001-Entity-ignore-case-when-uniquifying-name.patch (959 bytes) added
Do annotations refer back to entities by name, or by id? I believe it's by name (hence this bug), so I think it's safe for me to just rename or delete the offending duplicate entity.
Replying to [wjt]comment:1:
its referenced by id, before deleting possibly run sumething like this:
additionalName are not alternativeNames. alternativeNames + name are unique.
additional names are just additional names and can overlap.
patch looks better but should also check for alternativeNames, will have a look...
In []changeset:pandora,4935:
Sorry, I meant to say
alternativeNames
notadditional_names
above.I still don't think this prevents
alternativeNames
overlappingname
– I think you need the same uniquifying logic for each name here:Suppose entity ABC has
name: "Foo"
; and I now create entity DEF withname: "Bar", alternativeNames: ["Foo"]
. Thenname_find
for ABC will be|Foo|
;name_find
for DEF will be `|Bar|Foo|will get both rows back and throw the same exception as above. (If I tried to create ABC after DEF, your patch would correctly uniquify ABC's name to "Foo [2]".)
In []changeset:pandora,4937: