-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): return the correct file on multiple files with same name #234
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #234 +/- ##
=======================================
Coverage 70.11% 70.11%
=======================================
Files 11 11
Lines 609 609
=======================================
Hits 427 427
Misses 182 182
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such an effective fix! Can you think of any edge cases that this would break backwards compatibility?
I thought about it for a while and it won't break anything. But I see an issue that has nothing to do with this or the previous PRs: One can upload multiple files with the same name, but that was already possible with the |
I created a separate discussion #241
A bit more info: If multiple files with the same name are on the server, the file with the longest expiry timestamp will be returned when accessing the file via Previously a different file was returned. Which one is not entirely clear depending on expiration but not yet cleaned from disk, and so on. But this was never a defined behavior anyway, thus no breaking change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this and creating a discussion! I will get to that soon - I think this PR is in good shape to merge now.
Description
The
glob_match_file
function returns the wrong entry.glob
yields paths in alphabetical order. We want the file with the longest expiry date/time.Motivation and Context
fixes #218
How Has This Been Tested?
Changelog Entry
Types of Changes
Checklist: