-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Finding areas that are untested and need love #4131
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4131 +/- ##
==========================================
+ Coverage 90.84% 92.08% +1.24%
==========================================
Files 116 116
Lines 8028 7960 -68
==========================================
+ Hits 7293 7330 +37
+ Misses 735 630 -105
Continue to review full report at Codecov.
|
7c3e67e
to
ff25ba1
Compare
- Fixes issue with small requests (0-2)
This reverts commit e2d2a16.
- A note mentioned that it would be possible to leverage using the indexes on username/email to infer which is duplicated
8c6b29a
to
8cd7eb0
Compare
@acinader I'm done with that one! :)
|
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.
niiiice.
src/RestWrite.js
Outdated
@@ -1011,9 +1011,19 @@ RestWrite.prototype.runDatabaseOperation = function() { | |||
if (this.className !== '_User' || error.code !== Parse.Error.DUPLICATE_VALUE) { | |||
throw error; | |||
} | |||
|
|||
// Quick check, if we were able to infer the duplicated field name | |||
if (error && error.userInfo && error.userInfo.duplicated_field == 'username') { |
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.
string.equals
or ===
} | ||
|
||
function getRange(req) { | ||
const parts = req.get('Range').replace(/bytes=/, "").split("-"); |
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.
prefer ' to ". stay consistent
} | ||
|
||
// handleFileStream is licenced under Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). | ||
// Author: LEROIB at weightingformypizza (https://weightingformypizza.wordpress.com/2015/06/24/stream-html5-media-content-like-video-audio-from-mongodb-using-express-and-gridstore/). | ||
function handleFileStream(stream, req, res, contentType) { | ||
var buffer_size = 1024 * 1024;//1024Kb | ||
const buffer_size = 1024 * 1024; //1024Kb |
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.
👍 :).
src/Routers/FilesRouter.js
Outdated
end = start + (buffer_size); | ||
} | ||
chunksize = (end - start) + 1; | ||
// No start profided, we're reading backwards |
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.
typo in the comment: profided
//totalbytes = 0; | ||
// in case of small slices, all values will be good at that point | ||
// we've written enough, end... | ||
if (totalBytesWritten >= contentLength) { |
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.
I'm no expert at js io. is there a try / catch / finally idiom?
maybe something like: https://stackoverflow.com/questions/4092914/java-try-catch-finally-best-practices-while-acquiring-closing-resources
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.
uhm, I'm not sure, I kept the original code there, as it work working as expected, the changes I put in were just because the code was a duplicate. if it throws, express will catch it :)
No description provided.