-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Companion: make emitSuccess
and emitError
private
#3832
Conversation
also make method private
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.
We shouldn't make breaking changes between Uppy/Companion communication unless we have a very good reason for it. Ideally Companion should support old Uppy versions for many years.
I think extraData
is also used for XHR error reporting, it will send the response to the client so you can use the XHRUpload getResponseError
to handle errors the same way for local and Companion uploads.
How is this |
I haven't heard of |
uppy/packages/@uppy/xhr-upload/src/index.js Lines 428 to 433 in ef8c5cc
|
I just found it a bit dirty that in the existing code, const err = { message: 'test', extraData: { response: 'abc', error: 'something' } };
const { stack, ...serializedErr } = err;
console.log(JSON.stringify({ payload: { ...err.extraData, error: serializedErr } }, null, 2))
{
"payload": {
"response": "abc",
"error": {
"message": "test",
"extraData": {
"response": "abc",
"error": "something"
}
}
}
} We can see that |
emitSuccess
and emitError
private
The client doesn't use the nested At some point we may have to consider ways to upgrade the HTTP/socket APIs with backwards compat, so newer clients can opt into newer implementations and old clients still work. This case is too small to justify that work I think. |
Ok, I'll re-add the TODO then, hopefully in the future we can fix it |
| Package | Version | Package | Version | | -------------------- | ------------ | -------------------- | ------------ | | @uppy/companion | 4.0.0-beta.1 | @uppy/transloadit | 3.0.0-beta.2 | | @uppy/locales | 3.0.0-beta.2 | @uppy/robodog | 3.0.0-beta.2 | | @uppy/provider-views | 3.0.0-beta.2 | uppy | 3.0.0-beta.2 | - example: fix `custom-provider` example (Antoine du Hamel / #3854) - example: fix Vue3 example (Antoine du Hamel / #3774) - @uppy/companion: remove deprecated duplicated metrics (Mikael Finstad / #3833) - example: update CDN example (Antoine du Hamel / #3803) - @uppy/companion: Companion 3 default to no s3 acl (Mikael Finstad / #3826) - @uppy/companion: rewrite companion.app() to return an object (Mikael Finstad / #3827) - @uppy/companion: remove companion provider compat api (Mikael Finstad / #3828) - @uppy/companion: rewrite code for node >=14 (Mikael Finstad / #3829) - @uppy/companion: remove chunkSize backwards compatibility (Mikael Finstad / #3830) - @uppy/companion: Companion: make `emitSuccess` and `emitError` private (Mikael Finstad / #3832) - @uppy/companion: do not use a default upload protocol (Mikael Finstad / #3834)
* remove redundant extraData from error also make method private * revert breaking change * Update Uploader.js
| Package | Version | Package | Version | | -------------------- | ------------ | -------------------- | ------------ | | @uppy/companion | 4.0.0-beta.1 | @uppy/transloadit | 3.0.0-beta.2 | | @uppy/locales | 3.0.0-beta.2 | @uppy/robodog | 3.0.0-beta.2 | | @uppy/provider-views | 3.0.0-beta.2 | uppy | 3.0.0-beta.2 | - example: fix `custom-provider` example (Antoine du Hamel / transloadit#3854) - example: fix Vue3 example (Antoine du Hamel / transloadit#3774) - @uppy/companion: remove deprecated duplicated metrics (Mikael Finstad / transloadit#3833) - example: update CDN example (Antoine du Hamel / transloadit#3803) - @uppy/companion: Companion 3 default to no s3 acl (Mikael Finstad / transloadit#3826) - @uppy/companion: rewrite companion.app() to return an object (Mikael Finstad / transloadit#3827) - @uppy/companion: remove companion provider compat api (Mikael Finstad / transloadit#3828) - @uppy/companion: rewrite code for node >=14 (Mikael Finstad / transloadit#3829) - @uppy/companion: remove chunkSize backwards compatibility (Mikael Finstad / transloadit#3830) - @uppy/companion: Companion: make `emitSuccess` and `emitError` private (Mikael Finstad / transloadit#3832) - @uppy/companion: do not use a default upload protocol (Mikael Finstad / transloadit#3834)
also make method private
pulled out from #3791