FIX: Always reload post's raw when editing a post (#14085)

FIX: Always reload post’s raw when editing a post (#14085)

Sometimes the message bus update can be delayed and editing a post when that happens will automatically result in a draft conflict.

diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.js
index 85c69ad..c74a640 100644
--- a/app/assets/javascripts/discourse/app/models/composer.js
+++ b/app/assets/javascripts/discourse/app/models/composer.js
@@ -831,22 +831,13 @@ const Composer = RestModel.extend({
       this.setProperties(topicProps);
 
       promise = promise.then(() => {
-        let rawPromise = Promise.resolve();
-
-        if (!this.post.raw) {
-          rawPromise = this.store.find("post", opts.post.id).then((post) => {
-            this.setProperties({
-              post,
-              reply: post.raw,
-              originalText: post.raw,
-            });
-          });
-        } else {
+        let rawPromise = this.store.find("post", opts.post.id).then((post) => {
           this.setProperties({
-            reply: this.post.raw,
-            originalText: this.post.raw,
+            post,
+            reply: post.raw,
+            originalText: post.raw,
           });
-        }
+        });
 
         // edge case ... make a post then edit right away
         // store does not have topic for the post

GitHub sha: a56122f2d302a86305cd6525571d72b1b41e1608

This commit appears in #14085 which was approved by eviltrout and tgxworld. It was merged by nbianca.

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