Commit graph

16 commits

Author SHA1 Message Date
Pierre de La Morinerie
833d7a3b59 javascript: ignore most common upload errors also in standard uploads
In #5149, we ignored most common upload errors, but only for
auto-uploads.

This PR ignores those errors also for standard uploads.
2020-05-18 11:50:29 +02:00
Paul Chavard
43a1ead1cb fix new prettier defaults 2020-05-12 18:18:37 +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
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
a1083ca253 javascript: add some comments to the upload systems 2020-03-31 13:09:17 +02:00
Pierre de La Morinerie
bb024d1850 javascript: display a localized message on upload errors 2019-10-24 16:12:56 +02:00
Pierre de La Morinerie
a3057afc22 javascript: report upload errors to Sentry 2019-10-24 16:12:56 +02:00
Pierre de La Morinerie
78f75744e3 javascript: fix payload of ActiveStorage events missing on IE 11
Under some circumstances (like dispatching events just before a page
navigation), IE 11 events will be dispatched twice by the browser: once
with the payload, and a second time without.

To prevent these errors, ignore the events if the payload is missing.
2019-06-06 15:00:57 +02:00
Paul Chavard
0265c10474 Safari throw if deleting inexistent property 2019-05-14 17:12:27 +02:00
clemkeirua
ec2e17032e suppression de la double confirmation 2019-05-07 08:54:29 +02:00
Paul Chavard
5e806aa39e Add progress bar to model uploads 2019-02-14 17:13:41 +01:00
Paul Chavard
2f2aa580f8 Update activestorage.js 2018-12-04 11:37:00 +01:00
Pierre de La Morinerie
40d0986a82 javascript: transpile activestorage files (instead of copying them) 2018-08-14 11:40:33 +02:00
Paul Chavard
e7e616ae5b Fix transpiling issues in IE 2018-08-09 21:05:07 +02:00
Paul Chavard
8b79c32a55 Do not rely on javascript for form submits without direct upload 2018-08-07 16:58:49 +02:00