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

Events sometimes emitted with undefined file #3815

Closed
11 tasks
mifi opened this issue Jun 6, 2022 · 4 comments
Closed
11 tasks

Events sometimes emitted with undefined file #3815

mifi opened this issue Jun 6, 2022 · 4 comments
Labels

Comments

@mifi
Copy link
Contributor

mifi commented Jun 6, 2022

This has caused many errors like «cannot read properies of undefined» in the wild. I think we should prevent events from being emitted after a file has been set to undefined.
See #3811

Event that sometimes get emitted with file argument undefined:

  • upload-error
  • upload-started
  • upload-progress
  • upload-success
  • preprocess-progress
  • preprocess-complete
  • postprocess-progress
  • postprocess-complete
  • dashboard:file-edit-complete
  • file-added
  • file-removed

So we need to search for all occurrences of each of these, and make sure that we don't emit an undefined file argument.

For example here:

this.uppy.emit('upload-error', file, err)

we should probably return before emitting any events, or maybe better make sure files are only ever deleted after an upload has finished or failed.

@Murderlon
Copy link
Member

Can we make this issue more specific? It's not really actionable at the moment.

@mifi
Copy link
Contributor Author

mifi commented Jun 7, 2022

I updated the description

@heloineto
Copy link

heloineto commented Dec 21, 2023

When does this happen?

Is it when the user deletes the file before it's finished uploading?

@Murderlon
Copy link
Member

We haven't seen this happen anymore so the issue is not reproducible. Luckily we are migrating everything to TS, then we can make sure things are happening correctly.

@Murderlon Murderlon closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants