Describe the bug
It is possible to get the treefmt cache database into a bad state where all treefmt operations fail, including treefmt --clear-cache!
To Reproduce
We do not have a reproducer available, but we will update this ticket if we find one.
This issue manifests with errors instead of formatting:
$ treefmt
Error: failed to open cache: failed to open cache db: timeout
$ treefmt --clear-cache
Error: failed to open cache: failed to open cache db: timeout
Expected behavior
When treefmt is run, it should work instead of crashing.
If the cache database is corrupted, it should be deleted instead of crashing treefmt.
treefmt --clear-cache should never fail because the cache database is unavailable; the database should be deleted, not opened.
System information
macOS, treefmt v2.2.1
Additional context
The issue was resolved by manually deleting ~/Library/Caches/treefmt. This was challenging because the cache directory is not documented, and the source code implies it lives in $XDG_CACHE_HOME, which is not how treefmt behaves on macOS.
Describe the bug
It is possible to get the
treefmtcache database into a bad state where alltreefmtoperations fail, includingtreefmt --clear-cache!To Reproduce
We do not have a reproducer available, but we will update this ticket if we find one.
This issue manifests with errors instead of formatting:
Expected behavior
When
treefmtis run, it should work instead of crashing.If the cache database is corrupted, it should be deleted instead of crashing
treefmt.treefmt --clear-cacheshould never fail because the cache database is unavailable; the database should be deleted, not opened.System information
macOS, treefmt v2.2.1
Additional context
The issue was resolved by manually deleting
~/Library/Caches/treefmt. This was challenging because the cache directory is not documented, and the source code implies it lives in$XDG_CACHE_HOME, which is not howtreefmtbehaves on macOS.