mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: disable storing invalid post and topic timing when sent from client (#26683)
This ensures we only ever store correct post and topic timing when the client notifies. Previous to this change we would blindly trust the client. Additionally this has error correction code that will correct the last seen post number when you visit a topic with incorrect timings.
This commit is contained in:
@ -228,6 +228,12 @@ RSpec.describe TopicUser do
|
||||
today = Time.zone.now
|
||||
freeze_time Time.zone.now
|
||||
|
||||
# ensure data model is correct for the test
|
||||
# logging an update to a row that does not exist
|
||||
# is not supported
|
||||
_post1 = Fabricate(:post, topic: topic)
|
||||
_post2 = Fabricate(:post, topic: topic)
|
||||
|
||||
TopicUser.update_last_read(user, topic.id, 1, 1, 0)
|
||||
|
||||
tomorrow = 1.day.from_now
|
||||
|
Reference in New Issue
Block a user