mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
DEV: Do not abort direct S3 uploads if upload_debug_mode enabled (#14141)
See the previous commit d66b258b0e9a635a67007b1d95d3d50475f662cf 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…
x
Reference in New Issue
Block a user