From: Felix Ableitner <me@nutomic.com>
Date: Thu, 18 Feb 2021 15:15:52 +0000 (+0100)
Subject: Specify order for activities query (fixes #1436)
X-Git-Url: http://these/git/%7Bthis.getImageSrc%28%29%7D?a=commitdiff_plain;h=13a949d9ec0533235160417e729c045ead4046a4;p=lemmy.git

Specify order for activities query (fixes #1436)
---

diff --git a/crates/db_queries/src/source/activity.rs b/crates/db_queries/src/source/activity.rs
index b32c8f98..ad71e88d 100644
--- a/crates/db_queries/src/source/activity.rs
+++ b/crates/db_queries/src/source/activity.rs
@@ -110,7 +110,8 @@ impl Activity_ for Activity {
           .sql(" AND activity.data -> 'object' ->> 'type' = 'Create'")
           .sql(" AND activity.data -> 'object' -> 'object' ->> 'type' = 'Page'")
           .sql(" AND activity.data ->> 'actor' = ")
-          .bind::<Text, _>(community_actor_id),
+          .bind::<Text, _>(community_actor_id)
+          .sql(" ORDER BY activity.id DESC"),
       )
       .limit(20)
       .get_results(conn)?;