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

response data not passed to getResponseData like described when any integration e.g. Dropbox and therefor not available in uppyInstance.on('complete' #4915

Closed
2 tasks done
nikgraf opened this issue Feb 12, 2024 · 2 comments · Fixed by #4922
Labels

Comments

@nikgraf
Copy link

nikgraf commented Feb 12, 2024

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

Setup Uppy companion on the client. When using any integration like Dropbox the reponse will not be properly attached to the upload-success event and therefor also not to complete.

Expected behavior

In the docs the following is stated:

When uploading files from remote providers such as Dropbox or Instagram, Companion sends upload response data to the client. This is made available in the getResponseData() function as well. The response object from Companion has some properties named after their XMLHttpRequest counterparts.

Found the particular code that results in this not being the case. There even is a TODO:

case 'success': {
// @ts-expect-error event expects a lot more data.
// TODO: add missing data?
this.uppy.emit('upload-success', file, {
uploadURL: payload.url,
})
socketAbortController?.abort?.()
resolve()
break
}

While not correct, because the callback not being invoked I could fix the issue by patching the node_module with:

this.uppy.emit('upload-success', file, {
  body: JSON.parse(payload.response.responseText), // new line
  uploadURL: payload.url
});

Actual behavior

The response data from the websocket should be passed to upload-success.

@nikgraf nikgraf added the Bug label Feb 12, 2024
@orban
Copy link

orban commented Feb 14, 2024

Also running into similar issues, local uploads work as expected, but any integration fails as we don't get the correct callback information.

@Murderlon
Copy link
Member

Hi, I'll take a look today

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.

3 participants