-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(object): Takes into account the range of bytes starting with 0 #755
Conversation
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.
These look pretty good to me, do you think you could add a quick test case with the range that wasn't working before? There should be some existing tests that you can borrow from.
lib/stores/filesystem.js
Outdated
try { | ||
await fs.access(bucketPath, fs.constants.F_OK); | ||
} catch (ex) { | ||
exists = true; |
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 refactoring this, I wasn't sure exactly where the Windows tests were going wrong since I replaced fs-extra.
Could you move this to the utils file as ensureDir(path)
? You should also check that the exception code is ENOENT
and rethrow when it's not. You can also move the mkdir
call below directly to this catch block instead of storing a temporary variable.
Hey @kherock , the ranges changes were done in a separate PR: #753 I'll revisit this PR again to refactor a few more things and get back to you. Thanks! |
Codecov Report
@@ Coverage Diff @@
## main #755 +/- ##
==========================================
- Coverage 89.53% 89.49% -0.04%
==========================================
Files 22 22
Lines 1471 1476 +5
==========================================
+ Hits 1317 1321 +4
- Misses 154 155 +1
Continue to review full report at Codecov.
|
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.
This looks good, thanks. I'll merge and backport to 3.x when I have time.
This PR is related to this issue: #754 |
Fixes errors when trying to re-create directories that already exist.
Uses a helper function to verify for the directory existence first.
Note this PR also includes the fix for
options.start !== undefined
as I've built on top of my previous branch.