suborbital / subo

The Suborbital CLI
Apache License 2.0
81 stars 25 forks source link

version check continuously fails if cached timestamp is an empty string #168

Closed denopink closed 2 years ago

denopink commented 2 years ago

We discovered it during a code review for #22 .

The error was caused by an empty string saved as the cached timestamp. ℹ️ failed to getLatestVersion: failed to getTimestampCache: failed to getTimestampCache: failed to parse cached timestamp: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"

Oddly enough, I have no idea how this occurred... since an empty timestamp is always converted to 0001-01-01T00:00:00Z depending on the layout arg.

However, subo should just purge the bad data. Currently it does not do that and it just continuously fails due to the empty string.

Might as well do this for the cached release data.

cohix commented 2 years ago

Done! Thanks @denopink