Restrict UID search query to prefixes, matching displayed ones #327
Labels
breaking
involves breaking changes of some kind
help wanted
interface
changes the user interface in a non trivial way
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 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 list
correctly displays:a
, andb
.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:
However, the
--uid
parameter 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
Index
column. 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:
The text was updated successfully, but these errors were encountered: