* refactor(completion): separate cache validation from update logic
- Add NeedsUpdate() to check if completion cache is stale
- Rename Update() to UpdateCache() and make it unconditional
- Move caching decision to call sites (Show and sync.Run)
- Improve error handling with proper defer for file close
* increase completion coverage
* launch goroutine if update is needed
* remove user dependent test
* Don't rely on transparent decompression in sync list
The current sync list code relies on the HTTP client library transparently
decompressing the packages.gz file. This only works if the server provides
the 'Content-Encoding: gzip" HTTP header, which has apparently changed
recently.
This patch explicitly decompresses the package list if no encoding
information is provided by the server.
Fixes: https://github.com/Jguer/yay/issues/2709
v2: added gzip closer and added error handling
v3: blindly attempt to decompress, since the content encoding is
stripped by the HTTP client when transparently decompressing.
v4: also fix the fetch in command completion using common interface
Signed-off-by: Edwin Peer <espeer@gmail.com>
* fix failing tests, add fallback logging, add gz testcase
* fix lint
---------
Signed-off-by: Edwin Peer <espeer@gmail.com>