Skip to content

Commit

Permalink
Improve comments loading performance on long threads
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv committed Mar 27, 2015
1 parent 3f323cd commit 35010cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## v0.15 “SideScope”

* Improved performance when loading comments for long threads (thanks @dandv!).
* Usernames are now case and space insensitive. `John Smith`, `JohnSmith`, and `johnsmith` are now all considered to be the same username (thanks @splendido!).
* Romanian translation (thanks @razvansky!).
* Now using `feedparser` instead of `htmlparser2` to parse RSS feeds (thanks @delgermurun).
* Now using `feedparser` instead of `htmlparser2` to parse RSS feeds (thanks @delgermurun!).
* Now supporting RSS categories (thanks @delgermurun).
* Added new `postListTop` zone that only appears on post lists.
* Now showing tagline on every post list.
Expand Down
2 changes: 1 addition & 1 deletion server/publications/single_comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Meteor.publish('singleCommentAndChildren', function(commentId) {
var commentIds = [commentId];
var childCommentIds = _.pluck(Comments.find({parentCommentId: commentId}, {fields: {_id: 1}}).fetch(), '_id');
commentIds = commentIds.concat(childCommentIds);
return Comments.find({_id: {$in: commentIds}});
return Comments.find({_id: {$in: commentIds}}, {sort: {score: -1, postedAt: -1}});
}
return [];
});
Expand Down
2 changes: 1 addition & 1 deletion server/publications/single_post.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Meteor.publish('postUsers', function(postId) {

Meteor.publish('postComments', function(postId) {
if (can.viewById(this.userId)){
return Comments.find({postId: postId});
return Comments.find({postId: postId}, {sort: {score: -1, postedAt: -1}});
}
return [];
});

0 comments on commit 35010cc

Please sign in to comment.