DEV: correct test suite

DEV: correct test suite

We have no choice but to bypass recursive debouncers in test

Otherwise we overrun the stack with frames

diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js
index e86b14b..cd3d357 100644
--- a/app/assets/javascripts/discourse/app/controllers/composer.js
+++ b/app/assets/javascripts/discourse/app/controllers/composer.js
@@ -1096,7 +1096,11 @@ export default Controller.extend({
     const model = this.model;
     if (model) {
       if (model.draftSaving) {
-        debounce(this, this._saveDraft, 2000);
+        // in test debounce is Ember.run, this will cause
+        // an infinite loop
+        if (ENV.environment !== "test") {
+          debounce(this, this._saveDraft, 2000);
+        }
       } else {
         model.saveDraft().finally(() => {
           this._lastDraftSaved = Date.now();

GitHub sha: 3d050bda

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/hangs-discourse/161248/6