-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Avoid Random.id() on addFile #299
Labels
Comments
@dr-dimitru works like a charm. Thanks a lot, like always, great work/support! |
dr-dimitru
added a commit
that referenced
this issue
Dec 15, 2016
- NPM dependencies update - Support for updated *Buffer* API on node >= 6.* - Methods `addFile`, `write` and `load` now supports `userId` option, see #305 - Fix for unfinished uploads, now files is removed by upload TTL. See #267, thanks to @ck23onGithub - Better FS-stream management on server. Less memory and CPU consumption. Only one descriptor per upload. Fix FS-permissions - `.unlink()` method now supports callback - Docs for [MUP/Docker integration](https://github.com/VeliovGroup/Meteor-Files/wiki/MeteorUp-( MUP)-Usage) - Fix #293 - Fix #299 - BEtter AWS dos, see #282 - `storagePath` now always is function, if *String* is passed - it will be wrapped into function - Please participate at [this thread](#309) to give a right path for Meteor-Files v2.0
Merged
dr-dimitru
added a commit
that referenced
this issue
Dec 15, 2016
v1.7.6 - NPM dependencies update - Support for updated *Buffer* API on node >= 6.* - Methods `addFile`, `write` and `load` now supports `userId` option, see #305 - Fix for unfinished uploads, now files is removed by upload TTL. See #267, thanks to @ck23onGithub - Better FS-stream management on server. Less memory and CPU consumption. Only one descriptor per upload. Fix FS-permissions - `.unlink()` method now supports callback - Docs for [MUP/Docker integration](https://github.com/VeliovGroup/Meteor-Files/wiki/MeteorUp-(MUP)-Usage) - Fix #293 - Fix #299 - BEtter AWS dos, see #282 - `storagePath` now always is function, if *String* is passed - it will be wrapped into function - Please participate at [this thread](#309) to give a right path for Meteor-Files v2.0
Published as v1.7.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think its reasonable to switch from
Random.id()
to_id
as a part of the insert callback.https://github.com/VeliovGroup/Meteor-Files/blob/master/files.coffee#L1412
Moreover, it should be noted that
fileRef
in the callback ofaddFile
is not the inserted document like described in https://github.com/VeliovGroup/Meteor-Files/blob/dd59d886db69e8d74db3ebb5e1c7bde74f0b64c9/docs/addFile.mdInstead it's a predicted document, as data is not fetched from the database after insert. This may also fail on the next calls like
proceedAfterUpload
. We subclass collection.insert and add some extra fields like timestamps, in those cases wefindOne(fileRef._id)
to fetch the real document) and pass it toproceedAfterUpload
on callback.The text was updated successfully, but these errors were encountered: