Description of the issue:
khard list displays unique prefixes of the UID field,
which is sufficient and convenient to uniquely identify a contact.
However, the search query uid:xxx returns all contacts having "xxx" as a
substring of their UID, not just a prefix.
This makes the displayed UID prefix useless as a unique identifier for
selecting contacts for viewing or editing.
Minimal problematic case:
Consider an address book with two contacts:
- one with "UID: aaabbbb", and
- one with "UID: bbbaaaa".
khard list correctly displays:
- the first with short Uid prefix
a, and
- the second with short Uid prefix
b.
But khard edit uid:a matches both instead of only the first,
because "a" is a substring of both UIDs!
Workaround:
The full UID can be displayed with --parsable,
which makes it usable in scripts but is bad for humans.
Related issue:
Going further:
I think that working unique short UID prefixes could completely replace the
Index column. Those numeric indexes have the issue of being tied to a
particular context, therefore ephemeral and confusing, while not necessarily
shorter than UID prefixes.
Version info:
- Khard version 0.18.0
- Python 3.10.12
- NixOS 23.05
Description of the issue:
khard listdisplays unique prefixes of the UID field,which is sufficient and convenient to uniquely identify a contact.
However, the search query
uid:xxxreturns all contacts having "xxx" as asubstring of their UID, not just a prefix.
This makes the displayed UID prefix useless as a unique identifier for
selecting contacts for viewing or editing.
Minimal problematic case:
Consider an address book with two contacts:
khard listcorrectly displays:a, andb.But
khard edit uid:amatches both instead of only the first,because "a" is a substring of both UIDs!
Workaround:
The full UID can be displayed with
--parsable,which makes it usable in scripts but is bad for humans.
Related issue:
However, the
--uidparameter is now deprecated in favour of the new searchquery style
uid:something, which is the object of the current issue.Going further:
I think that working unique short UID prefixes could completely replace the
Indexcolumn. Those numeric indexes have the issue of being tied to aparticular context, therefore ephemeral and confusing, while not necessarily
shorter than UID prefixes.
Version info: