mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Do not destroy external upload stub on error in debug mode (#14139)
We do not want to destroy the external upload stub records in debug mode because they allow for investigation of problems occuring.
This commit is contained in:
@@ -127,6 +127,13 @@ RSpec.describe ExternalUploadManager do
|
||||
expect { subject.promote_to_upload! }.to raise_error(ExternalUploadManager::ChecksumMismatchError)
|
||||
expect(ExternalUploadStub.exists?(id: external_upload_stub.id)).to eq(false)
|
||||
end
|
||||
|
||||
it "does not delete the stub if enable_upload_debug_mode" do
|
||||
SiteSetting.enable_upload_debug_mode = true
|
||||
expect { subject.promote_to_upload! }.to raise_error(ExternalUploadManager::ChecksumMismatchError)
|
||||
external_stub = ExternalUploadStub.find(external_upload_stub.id)
|
||||
expect(external_stub.status).to eq(ExternalUploadStub.statuses[:failed])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -146,6 +153,13 @@ RSpec.describe ExternalUploadManager do
|
||||
"#{upload_base_url}/#{external_upload_stub.key}"
|
||||
)
|
||||
end
|
||||
|
||||
it "does not delete the stub if enable_upload_debug_mode" do
|
||||
SiteSetting.enable_upload_debug_mode = true
|
||||
expect { subject.promote_to_upload! }.to raise_error(ExternalUploadManager::SizeMismatchError)
|
||||
external_stub = ExternalUploadStub.find(external_upload_stub.id)
|
||||
expect(external_stub.status).to eq(ExternalUploadStub.statuses[:failed])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user