FIX: Reset preProcessorStatus state correctly for composer-upload-uppy (#14111)

FIX: Reset preProcessorStatus state correctly for composer-upload-uppy (#14111)

When resetting the preprocessor status states, we weren’t using the same default state as when the preprocessor status state is first initialized with an associated plugin. This commit brings the two into alignment, fixing a bug where if you cancelled an upload then tried a new one the “Processing Upload” message would never change to “Uploading… X”, so any subsequent uploads were uncancellable.

Since the state was not being reset correctly, the properties that were supposed to be numbers ended up as undefined, so when calling prop-- or prop++, they turned into NaN.

diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
index 220c942..d7b88d7 100644
--- a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
+++ b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
@@ -352,7 +352,12 @@ export default Mixin.create({
       isCancellable: false,
     });
     this._eachPreProcessor((pluginClass) => {
-      this._preProcessorStatus[pluginClass] = {};
+      this._preProcessorStatus[pluginClass] = {
+        needProcessing: 0,
+        activeProcessing: 0,
+        completeProcessing: 0,
+        allComplete: false,
+      };
     });
     this.fileInputEl.value = "";
   },

GitHub sha: 4dc93a53e4f48b0ee074f6a49e7b3f9cee7e7e80

This commit appears in #14111 which was approved by lis2. It was merged by martin.