mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
FIX: don't blow up if the topic does not exists anymore
PERF: only select the only field we use introduced in 7c741fa0d673f3c808cf3f77127e44e823ea40f8 (cc @romanrizzi)
This commit is contained in:
parent
48ee8f2abc
commit
e3eb49729c
@ -128,14 +128,14 @@ class TopicTrackingState
|
||||
end
|
||||
|
||||
def self.publish_read(topic_id, last_read_post_number, user_id, notification_level = nil)
|
||||
topic = Topic.select(:highest_post_number, :archetype, :id).find_by(id: topic_id)
|
||||
highest_post_number = DB.query_single("SELECT highest_post_number FROM topics WHERE id = ?", topic_id).first
|
||||
|
||||
message = {
|
||||
topic_id: topic_id,
|
||||
message_type: "read",
|
||||
payload: {
|
||||
last_read_post_number: last_read_post_number,
|
||||
highest_post_number: topic.highest_post_number,
|
||||
highest_post_number: highest_post_number,
|
||||
topic_id: topic_id,
|
||||
notification_level: notification_level
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user