Commit graph

10 commits

Author SHA1 Message Date
Paul Chavard
43a1ead1cb fix new prettier defaults 2020-05-12 18:18:37 +02:00
Pierre de La Morinerie
769e98f63e javascript: fix the progress bar removal on success
When using auto-attach, the response HTML fragment replaces the progress
bar – so it doesn't need to be removed twice.
2020-04-16 17:02:23 +02:00
Pierre de La Morinerie
b2231e98d5 javascript: don't report connectivity issues to Sentry 2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
432967bd76 javascript: make Uploader always throw the same kind of errors
A DirectUpload may fail for several reasons, and return many types of
errors (string, xhr response, Error objects, etc).

For convenience, wrap all these errors in a FileUploadError object.

- It makes easier for clients of the Uploader class to handle errors;
- It allows to propagate the error code and failure responsability.
2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
d8f3b86b0e javascript: move auto-upload attachment to the Uploader class
Rationale:

- It makes more sense to handle the progress bar updates in a single class;
- This will allow us to unify the error handling.
2020-04-16 11:20:45 +02:00
Pierre de La Morinerie
c633cd0888 javascript: improve Sentry grouping of direct upload errors
DirectUpload returns errors as strings, including an HTTP status and a
file name (and without a stack trace).

But Sentry groups issues according to the stack trace, and maybe the
error message in last resort.

So we have an issue: as all DirectUpload errors logged by Sentry are
generated on the same line, with random-looking messages, Sentry groups
them either too or too little aggressively.

Instead of creating all the errors on the same line:

- add some `if`s statements to create them on different lines (and so
  with different stack traces),
- strip the file name from the error message.

This allows Sentry to group the errors properly, with meaningful error
messages.
2020-04-09 17:38:44 +02:00
Pierre de La Morinerie
bc1c15b81d javascript: make DirectUpload errors return true error objects
DirectUpload errors are string (instead of error objects). But Sentry
works better if we have true errors, which include the stacktrace.
2020-04-09 12:50:47 +02:00
Pierre de La Morinerie
a1083ca253 javascript: add some comments to the upload systems 2020-03-31 13:09:17 +02:00
Paul Chavard
860588b216 Upgrade javascript dependencies and add actiontext 2019-07-03 11:42:25 +02:00
Paul Chavard
5e806aa39e Add progress bar to model uploads 2019-02-14 17:13:41 +01:00