The json::object::parse_pair function calls getQuoted to parse object keys. This means that object::_data contains JSON-escaped keys.
This causes the following issue in timewarrior as of GothenburgBitFactory/timewarrior@bdb28fa:
$ timew start '"a'
Note: '"\"a"' is a new tag.
Tracking "\"a"
[…]
$ timew stop
Trying to decrement non-existent tag '"a'
After timew start is run, the tags.data file contains {"\"a":{"count":1}}. When running timew stop, libshared's parse_pair parses the key "\"a", but does not unescape it. This causes timewarrior not to find "a because the key is internally stored as \"a.
Possible solutions:
- Add a function to retrieve the key name in unescaped form and change timewarrior to use this function
- Change the internal representation of
_data to store the unescaped string
Possibly related to GothenburgBitFactory/timewarrior#159
The
json::object::parse_pairfunction callsgetQuotedto parse object keys. This means thatobject::_datacontains JSON-escaped keys.This causes the following issue in timewarrior as of GothenburgBitFactory/timewarrior@bdb28fa:
After
timew startis run, thetags.datafile contains{"\"a":{"count":1}}. When runningtimew stop, libshared'sparse_pairparses the key"\"a", but does not unescape it. This causes timewarrior not to find"abecause the key is internally stored as\"a.Possible solutions:
_datato store the unescaped stringPossibly related to GothenburgBitFactory/timewarrior#159