diff --git a/lib/classes/sidebar/BlubberThreadsWidget.php b/lib/classes/sidebar/BlubberThreadsWidget.php
index ab0bab738b8e185bb4ca65bf6a859e77ded6594c..b02e027e2d14d14017e71d9ebe5ecdf837634198 100644
--- a/lib/classes/sidebar/BlubberThreadsWidget.php
+++ b/lib/classes/sidebar/BlubberThreadsWidget.php
@@ -40,6 +40,7 @@ class BlubberThreadsWidget extends SidebarWidget
                 'avatar' => $thread->getAvatar(),
                 'name' => $thread->getName(),
                 'timestamp' => (int) $thread->getLatestActivity(),
+                'mkdate' => (int) $thread->mkdate,
                 'unseen_comments' => $unseen_comments,
                 'notifications' => $thread->id === 'global' || ($thread->context_type === 'course' && !$GLOBALS['perm']->have_perm('admin')),
                 'followed' => $thread->isFollowedByUser(),
diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php
index 7b0af06d919211d182642cb1fd13cbad78a1c0d8..cccaa3de92893845c699ccea41d92052a53b1755 100644
--- a/lib/models/BlubberThread.php
+++ b/lib/models/BlubberThread.php
@@ -279,7 +279,7 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
                 ['olderthan' => $olderthan]
             );
         }
-        $query->orderBy("IFNULL(MAX(blubber_comments.mkdate), blubber_threads.mkdate) DESC");
+        $query->orderBy("MAX(blubber_comments.mkdate) DESC, blubber_threads.mkdate DESC");
         $query->limit($limit);
 
         $threads = $query->fetchAll(static::class);
@@ -291,7 +291,7 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
         $since = 0;
         $olderthan = time();
         foreach ($upgraded_threads as $thread) {
-            $active_time = $thread->getLatestActivity();
+            $active_time = $thread->getLatestActivity(true);
             $since = max($since, $active_time);
             $olderthan = min($olderthan, $active_time);
         }
@@ -581,10 +581,13 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
         return OpenGraph::extract($this['content']);
     }
 
-    public function getLatestActivity()
+    public function getLatestActivity(bool $include_mkdate = false)
     {
         $newest_comment = BlubberComment::findOneBySQL("thread_id = ? ORDER BY mkdate DESC", [$this->getId()]);
-        return $newest_comment ? $newest_comment['mkdate'] : $this['mkdate'];
+        if ($newest_comment) {
+            return $newest_comment->mkdate;
+        }
+        return $include_mkdate ? $this->mkdate : null;
     }
 
     public function getURL()
diff --git a/resources/vue/components/BlubberThreadWidget.vue b/resources/vue/components/BlubberThreadWidget.vue
index 12514eb20396bc7c2641cac05eb7131ad1018811..2a2de1ca5f7ae43c518901df125a964d891a495e 100644
--- a/resources/vue/components/BlubberThreadWidget.vue
+++ b/resources/vue/components/BlubberThreadWidget.vue
@@ -104,7 +104,11 @@
         },
         computed: {
             sortedThreads () {
-                return this.threads.sort((a, b) => b.timestamp - a.timestamp);
+                return this.threads.sort((a, b) => {
+                    return b.timestamp - a.timestamp
+                        || b.mkdate - a.mkdate
+                        || b.name.localeCompare(a.name);
+                });
             }
         }
     }