mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
DEV: Do not abort direct S3 uploads if upload_debug_mode enabled (#14141)
See the previous commit d66b258b0e
as
well.
If enable_upload_debug_mode is true, we do not want to abort the
direct S3 upload, because that will delete the file on S3 and prevent
further inspection of any errors that have come up.
This commit is contained in:
parent
419d71abcb
commit
58e9fffe4c
@ -239,6 +239,8 @@ export default Mixin.create({
|
||||
this._inProgressUploads--;
|
||||
this._resetUpload(file, { removePlaceholder: true });
|
||||
|
||||
file.meta.error = error;
|
||||
|
||||
if (!this.userCancelled) {
|
||||
displayErrorForUpload(response || error, this.siteSettings, file.name);
|
||||
this.appEvents.trigger("composer:upload-error", file);
|
||||
@ -433,6 +435,13 @@ export default Mixin.create({
|
||||
return;
|
||||
}
|
||||
|
||||
// this gives us a chance to inspect the upload stub before
|
||||
// it is deleted from external storage by aborting the multipart
|
||||
// upload; see also ExternalUploadManager
|
||||
if (file.meta.error && self.siteSettings.enable_upload_debug_mode) {
|
||||
return;
|
||||
}
|
||||
|
||||
return ajax("/uploads/abort-multipart.json", {
|
||||
type: "POST",
|
||||
data: {
|
||||
|
@ -283,6 +283,7 @@ basic:
|
||||
enable_upload_debug_mode:
|
||||
default: false
|
||||
hidden: true
|
||||
client: true
|
||||
default_theme_id:
|
||||
default: -1
|
||||
hidden: true
|
||||
|
Loading…
Reference in New Issue
Block a user