DEV: Remove defunct TODOs (#19825)

* Firefox now finally returns PerformanceMeasure from performance.measure
* Some TODOs were really more NOTE or FIXME material or no longer relevant
* retain_hours is not needed in ExternalUploadsManager,  it doesn't seem like anywhere in the UI sends this as a param for uploads
* https://github.com/discourse/discourse/pull/18413 was merged so we can remove JS test workaround for settings
This commit is contained in:
Martin Brennan 2023-01-12 09:41:39 +10:00 committed by GitHub
parent 92bb728fe5
commit 21a95b000e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 7 additions and 24 deletions

View File

@ -106,8 +106,6 @@ export default Component.extend(ComposerUploadUppy, {
fileUploadElementId: "file-uploader", fileUploadElementId: "file-uploader",
mobileFileUploaderId: "mobile-file-upload", mobileFileUploaderId: "mobile-file-upload",
// TODO (martin) Remove this once the chat plugin is using the new composerEventPrefix
eventPrefix: "composer",
composerEventPrefix: "composer", composerEventPrefix: "composer",
uploadType: "composer", uploadType: "composer",
uppyId: "composer-editor-uppy", uppyId: "composer-editor-uppy",

View File

@ -74,7 +74,7 @@ export default Mixin.create(UploadDebugging, {
} }
}, },
// TODO (martin) This and _onPreProcessComplete will need to be tweaked // NOTE: This and _onPreProcessComplete will need to be tweaked
// if we ever add support for "determinate" preprocessors for uppy, which // if we ever add support for "determinate" preprocessors for uppy, which
// means the progress will have a value rather than a started/complete // means the progress will have a value rather than a started/complete
// state ("indeterminate"). // state ("indeterminate").

View File

@ -31,7 +31,6 @@ export default Mixin.create({
_instrumentUploadTimings() { _instrumentUploadTimings() {
if (!this._performanceApiSupport()) { if (!this._performanceApiSupport()) {
// TODO (martin) (2021-01-23) Check if FireFox fixed this yet.
warn( warn(
"Some browsers do not return a PerformanceMeasure when calling performance.mark, disabling instrumentation. See https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#return_value and https://bugzilla.mozilla.org/show_bug.cgi?id=1724645", "Some browsers do not return a PerformanceMeasure when calling performance.mark, disabling instrumentation. See https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#return_value and https://bugzilla.mozilla.org/show_bug.cgi?id=1724645",
{ id: "discourse.upload-debugging" } { id: "discourse.upload-debugging" }

View File

@ -43,9 +43,6 @@ class ExternalUploadStub < ActiveRecord::Base
@statuses ||= Enum.new(created: 1, uploaded: 2, failed: 3) @statuses ||= Enum.new(created: 1, uploaded: 2, failed: 3)
end end
# TODO (martin): Lifecycle rule would be best to clean stuff up in the external
# systems, I don't think we really want to be calling out to the external systems
# here right?
def self.cleanup! def self.cleanup!
expired_created.delete_all expired_created.delete_all
expired_uploaded.delete_all expired_uploaded.delete_all

View File

@ -149,8 +149,6 @@ class ExternalUploadManager
raise ChecksumMismatchError if external_sha1 && external_sha1 != actual_sha1 raise ChecksumMismatchError if external_sha1 && external_sha1 != actual_sha1
end end
# TODO (martin): See if these additional opts will be needed
# - check if retain_hours is needed
opts = { opts = {
type: external_upload_stub.upload_type, type: external_upload_stub.upload_type,
existing_external_upload_key: external_upload_stub.key, existing_external_upload_key: external_upload_stub.key,

View File

@ -175,12 +175,9 @@ class S3Helper
cors_rules: final_rules, cors_rules: final_rules,
}, },
) )
rescue Aws::S3::Errors::AccessDenied => err rescue Aws::S3::Errors::AccessDenied
# TODO (martin) Remove this warning log level once we are sure this new Rails.logger.info(
# ensure_cors! rule is functioning correctly. "Could not PutBucketCors rules for #{@s3_bucket_name}, rules: #{final_rules}",
Discourse.warn_exception(
err,
message: "Could not PutBucketCors rules for #{@s3_bucket_name}, rules: #{final_rules}",
) )
return false return false
end end

View File

@ -57,9 +57,6 @@ class UploadCreator
true true
end end
) )
# TODO (martin) Validate @opts[:type] to make sure only blessed types are passed
# in, since the clientside can pass any type it wants.
end end
def create_for(user_id) def create_for(user_id)
@ -78,13 +75,13 @@ class UploadCreator
is_image ||= @image_info && FileHelper.is_supported_image?("test.#{@image_info.type}") is_image ||= @image_info && FileHelper.is_supported_image?("test.#{@image_info.type}")
is_image = false if @opts[:for_theme] is_image = false if @opts[:for_theme]
# if this is present then it means we are creating an upload record from # If this is present then it means we are creating an upload record from
# an external_upload_stub and the file is > ExternalUploadManager::DOWNLOAD_LIMIT, # an external_upload_stub and the file is > ExternalUploadManager::DOWNLOAD_LIMIT,
# so we have not downloaded it to a tempfile. no modifications can be made to the # so we have not downloaded it to a tempfile. no modifications can be made to the
# file in this case because it does not exist; we simply move it to its new location # file in this case because it does not exist; we simply move it to its new location
# in S3 # in S3
# #
# TODO (martin) I've added a bunch of external_upload_too_big checks littered # FIXME: I've added a bunch of external_upload_too_big checks littered
# throughout the UploadCreator code. It would be better to have two seperate # throughout the UploadCreator code. It would be better to have two seperate
# classes with shared methods, rather than doing all these checks all over the # classes with shared methods, rather than doing all these checks all over the
# place. Needs a refactor. # place. Needs a refactor.

View File

@ -16,13 +16,10 @@ module("Discourse Chat | Unit | chat-emoji-reaction-store", function (hooks) {
this.chatEmojiReactionStore.reset(); this.chatEmojiReactionStore.reset();
}); });
// TODO (martin) Remove site setting workarounds after core PR#1290
test("defaults", function (assert) { test("defaults", function (assert) {
assert.deepEqual( assert.deepEqual(
this.chatEmojiReactionStore.favorites, this.chatEmojiReactionStore.favorites,
(this.siteSettings.default_emoji_reactions || "") this.siteSettings.default_emoji_reactions.split("|").filter((val) => val)
.split("|")
.filter((val) => val)
); );
}); });