-
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
Uppy companion fails silently very often #4355
Comments
Hi! Thanks for your feedback. By "fail silently", you mean that:
|
|
by
And the user also receives and error about failing to connect to the provider. So not sure how to reproduce this. If you're able to reproduce and know how to fix it, feel free to submit a PR :) I tried to set COMPANION_UPLOAD_URLS=http://google.com and run an upload, and it does not fail silently. It logs both an error in companion and show to the user that the upload failed:
I'm not sure if I agree with this. I think user-facing error messages should not contain technical mumbo-jumbo that the user does not understand. This information should instead be logged and picked up by a crash reporting system by the developers of the app and then acted upon. In development, logging to console.error is a good way for developers to identify problems, and the error doesn't need to be presented to them in a toast. However if the toast error message is not very good, maybe we could improve it, like instead saying "Please try again or contact us if the problem persists"
Yes, please provide reproducible examples on how to make companion fail silently, that would be very valuable for fixing these problems. I agree that we can improve our typescript definitions. I've created a master issue for this: #4361 |
Regarding the COMPANION_HOST error, my apologies for not being clear enough about that. What I meant to say was this. Given these URLs:
I feel like it's possible to use regex under the hood to auto-format all URLs to match the required formatting. However, if that is not possible, then a nicer error message that clearly tells the user what the issue is would save some time. My original point is that there are a lot of moments when I set up companion where there is either
|
I'm stil lnot sure where you're putting those URLs you described, in order to trigger a silent failure. I cannot find any
Can you provide an example of how to reproduce these? Unfortunately CORS errors are known to be cryptic, for security reasons and the way they are implemented in the browsers, and not so much we can do about that, I believe. |
closing this until we have some reproducible code |
Initial checklist
Problem
I mean this in the nicest way possible, but the Uppy companion fails silently more than any other library I've seen.
For example, in my
COMPANION_HOST
env variable, I put a/
at the end, which caused it to fail silently. Then, there was also anhttps://
at the beginning, which caused it to fail silently. Before that, theuploadUrls
were wrong, and it failed silently. Another time, I looked at the network tab to see why things were broken, and there was a CORS error, but that was actually just misleadingly caused by some other random-seeming option being badly formatted.Solution
With some refactoring, the library could go from being in the top 1% of libraries that fail silently to never failing silently ever. It might even as simple as putting in guard rails, adding more try/catch blocks, or adding more descripting network responses. At the bare minimum, you should at least strongly type the companion options, which are currently typed as
object
.Alternatives
The text was updated successfully, but these errors were encountered: