Skip to content
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

progress 100 comes after uploaded #834

Closed
bladerunner2020 opened this issue Feb 13, 2022 · 0 comments · Fixed by #838
Closed

progress 100 comes after uploaded #834

bladerunner2020 opened this issue Feb 13, 2022 · 0 comments · Fixed by #838
Labels

Comments

@bladerunner2020
Copy link

I'm having an issue:

The event uploaded is triggered before event progress = 100.
My code:

    const upload = MediaLib.insert({
      file,
      chunkSize: 'dynamic',
      meta: {
        lastModified: (new Date(lastModified)).toISOString()
      }
    }, false);
    upload.on('start', () => setProgress(0));
    upload.on('progress', (value) => {
      console.log(value);
      setProgress(value);
    });
    upload.on('uploaded', (error) => {
      console.log('uploaded');
      // setProgress(null);
    });
    upload.start();

And the output is:

1
10
21
32
43
53
63
68
79
90
uploaded!
100

Meteor-files: ostrio:files@2.0.1
Meteor: 2.3.5
Mac/Safari Version 15.3 (17612.4.9.1.5)

@dr-dimitru dr-dimitru added the bug label Jun 8, 2022
dr-dimitru added a commit that referenced this issue Jun 9, 2022
__Major changes:__

- ⚠️ `FSName` now sanitized and limited to 28 symbols, no white-spaces allowed
- ⚠️ `fileId` now sanitized and limited to 20 symbols, no white-spaces allowed
- ⚠️ File extension now sanitized and limited to 20 symbols, no white-spaces allowed
- 📦 Decouple `fs-extra`, use native node.js `fs` module
- 👨‍💻 Add missing `isData` helper via #795, by @harryadel

__Changes:__

- 👷‍♂️ Fix: #827, thanks to @aertms
- 👷‍♂️ Fix: #832, thanks to @polygonwood
- 👷‍♂️ Fix: #813, thanks to @Prinzhorn
- 👨‍💻 Fix: #834, thanks to @bladerunner2020
- 📔 Fix: #803, thanks to @bartenra
- 🏗 Sanitize inputs (`FSName`, `fileId`, `extension`) to avoid command injection
- 📔 Improved documentation, special thanks to @Prinzhorn and @make-github-pseudonymous-again
- 📔 GridFS documentation fix: #818
- 👷‍♂️ Utilize `Meteor._debug` where possible instead of `console.log`

__Other:__

- 🤝 Compatibility with `meteor@2.7.3`
@dr-dimitru dr-dimitru mentioned this issue Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants