From 741da52ccd18bc3a465ba4248687054543dc1b3d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 29 May 2015 18:55:19 +0930 Subject: [PATCH] Sort included posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They can be out of order in the payload due to relationship loading, e.g. post #1 includes post #14 that has mentioned it, therefore #14 will be the first post in the payload. The new post stream doesn’t take kindly to out of order posts. --- framework/core/js/forum/src/components/discussion-page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/core/js/forum/src/components/discussion-page.js b/framework/core/js/forum/src/components/discussion-page.js index 8ba62ccda..27c516ae6 100644 --- a/framework/core/js/forum/src/components/discussion-page.js +++ b/framework/core/js/forum/src/components/discussion-page.js @@ -82,6 +82,7 @@ export default class DiscussionPage extends mixin(Component, evented) { includedPosts.push(app.store.getById('posts', record.id)); } }); + includedPosts.sort((a, b) => a.id() - b.id()); this.stream = new PostStream({ discussion, includedPosts }); this.stream.on('positionChanged', this.positionChanged.bind(this));