If you launch git-bug termui, it shows "A long while ago" for all issues. Hower, if you press enter on an issue and go back, its time gets set to the correct time. If you close termui and run again though, you get "A long while ago" again.
Same for git-bug list, the first run after removing the cache works as expected, but running after it's cached results in broken timestamps.
Michael Muré (MichaelMure) commented
sighttt
So what's happening is that I made a change in the cache format recently (https://github.com/MichaelMure/git-bug/commit/aab3a04d0c4ddbf97d589ba9048a539c6d7186e9) to store a timestamp there instead of a full decoded date. It saves some bytes and CPU, and there is no point in having something more precise in the cache than in the actual data. Part of that change include having unexported fields in BugExcerpt for the timestamps and some methods to export various format nicely for the rest of the code.
The problem is that I'm using golang's gob serialization format. This format will silently ignore unexported fields. This make no sense to me really as it tie together two different problematic: how we want to store and how we want to export the data in the code. This make me sad a little bit.
Michael Muré (MichaelMure) changed the title from cache: timestamps are not written properly on disk to cache: timestamps are not written properly on disk
Michael Muré (MichaelMure)
removed label
area/bridge
Michael Muré (MichaelMure)
added label
Core
karlicoss (karlicoss) commented
I see! I don't know much about Go, but sounds painful.
Not sure if I understood what you mean by exported/unexported fields? But anyway, as a short term compromise, wondering if keeping a full date is actually that bad? My hunch would be that bytes/CPU saved are low in comparison to all the other fields. But I might very well be wrong, and I've seen there are some benchmarks in the codebase, so I guess you have a better idea of how long it actually takes :)