suborbital / subo

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

bug patch: purge bad data cache from version check #170

Closed denopink closed 2 years ago

denopink commented 2 years ago

PR for #168

The bug is caused when an empty string is saved as the cached timestamp for version check. ℹ️ 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"

Until this patch, subo did not purge the bad cache for version check and so version check will continuously fail. Note, version check ran in a separate thread so it didn't affect any executed command.

We also applied the same patch for version check's cached repo release data as well. Not because we saw the same error for it, but it "could" happen in the future if a bad repo release data was cached some how.

Cheers! 🍻