>> 6.7.0, and any change to Leo's file format qualifies as a *highly*
>> significant change :-)
>>
>> Edward
>>
>
IDs should always be treated as blind tokens. Attempting to decode them
is asking for trouble precisely because it causes compatibility problems
and hard to trace bugs. The token generator needs to check against
existing tokens to verify uniqueness (Leo does this) and may perform
heuristics if it needs to ensure sequencing, but care must be taken to
safely handle unexpected input.
Leo decodes gnx in exactly two places:
The unit test for the token generator, which should never see tokens
created by a different version and thus is safe.
The ToDo plugin, in todo.py on line 1303. It takes proper precautions to
fail gracefully when it hits an ID it can't read because failures were a
known and expected issue when it was first created. Even something as
simple as a '.' in a user name is enough to trip it up.
There is a more general problem in Leo with not escaping output, which
can create unreadable files if unexpected characters are present. Raw
gnxes are written to both .leo files and in @file annotations,
preventing the use of the characters '<', '>', '"', '&', ':', and '\n'.
None of those characters occur in UUIDs, which are limited to [0-9A-F]
and '-'.
My proposed patch used UUID4, which are randomly generated and provide
strong guarantees of uniqueness. It was also gated by a user setting
that defaulted to 'off'.
UUID gnx is verified compatible with any recent Leo and should be
compatible all the way back to 4.1. That's why I felt comfortable
submitting it for 6.7.0.