Closed
Conversation
This isn't perfect, since using `startsWith` doesn't really guarantee an exact match, but it's good enough and certainly better than what I found.
jackieli-tes
added a commit
that referenced
this pull request
Mar 11, 2026
listObjects uses MinIO prefix matching, so key "foo" also returns "foo-bar/cache.tzst". The previous fix (PR #60) used startsWith(key) which still has the same problem. Use startsWith(key + "/") to ensure the key matches as a full path segment. Add a workflow test that saves a decoy cache with a longer key sharing the same prefix, then verifies exact restore does not match it.
3 tasks
jackieli-tes
added a commit
that referenced
this pull request
Mar 11, 2026
* fix: exact match should check key as path segment, not string prefix listObjects uses MinIO prefix matching, so key "foo" also returns "foo-bar/cache.tzst". The previous fix (PR #60) used startsWith(key) which still has the same problem. Use startsWith(key + "/") to ensure the key matches as a full path segment. Add a workflow test that saves a decoy cache with a longer key sharing the same prefix, then verifies exact restore does not match it. * fix: use path.sep instead of hardcoded "/" for Windows compatibility On Windows, path.join produces backslash separators, so MinIO objects have "\" in their names. The exact match check must use path.sep to match the platform's separator.
Contributor
|
Thanks for your contribution. fixed by #65 |
Author
I saw your fix, and you're absolutely right that this is still broken. Thanks for addressing the issue! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that exact matching is broken because I was seeing an old cache being restored, which can happen because:
listObjects()can return multiple objectslistObjects()Changes
Fix Issues
None, as I worked on the fix before reporting the issue.