diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-08 08:20:17 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-08 08:20:17 -0500 |
commit | a0491b592e51e65dcb300ae7138914322de86d67 (patch) | |
tree | feb472687548543c016eda3c664e473c9c02967a | |
parent | 5e4be8b0d43e3fed102b2ecb8d7a21ff2c3b6726 (diff) | |
parent | 910b3216fe78c8df53451ab33d359c42c5c5e38e (diff) | |
download | chat-a0491b592e51e65dcb300ae7138914322de86d67.tar.gz chat-a0491b592e51e65dcb300ae7138914322de86d67.tar.bz2 chat-a0491b592e51e65dcb300ae7138914322de86d67.zip |
Merge pull request #1644 from mattermost/plt-1279-1
PLT-1279 Make sure posts in common threads are included in getPosts DB query
-rw-r--r-- | store/sql_post_store.go | 3 | ||||
-rw-r--r-- | store/sql_post_store_test.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go index 035309e21..be770c09e 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -571,7 +571,8 @@ func (s SqlPostStore) getParentsPosts(channelId string, offset int, limit int) S AND DeleteAt = 0 ORDER BY CreateAt DESC LIMIT :Limit OFFSET :Offset) q3 - WHERE q3.RootId != '') q1 ON q1.RootId = q2.Id + WHERE q3.RootId != '') q1 + ON q1.RootId = q2.Id OR q1.RootId = q2.RootId WHERE ChannelId = :ChannelId2 AND DeleteAt = 0 diff --git a/store/sql_post_store_test.go b/store/sql_post_store_test.go index 12b50cad3..a3e3e10dd 100644 --- a/store/sql_post_store_test.go +++ b/store/sql_post_store_test.go @@ -445,7 +445,7 @@ func TestPostStoreGetPostsWtihDetails(t *testing.T) { t.Fatal("invalid order") } - if len(r1.Posts) != 5 { //the last 4, + o1 (o3 and o2a's parent) + if len(r1.Posts) != 6 { //the last 4, + o1 (o2a and o3's parent) + o2 (in same thread as o2a and o3) t.Fatal("wrong size") } |