For what is used the TopicTrackingState.report


(Piotr Szal) #1

I do not understand for what is used this report.
If I comment it out or not discourse seems to work correct.

Which feature is away when I comment out this lines in the application_controller.rb:

serializer = ActiveModel::ArraySerializer.new(TopicTrackingState.report([current_user.id]), each_serializer: TopicTrackingStateSerializer)
store_preloaded("topicTrackingStates", MultiJson.dump(serializer))

The Data from the report

[.... #<TopicTrackingState:0x007fdbe04ace78
 @category_name="dev",
 @created_at=2014-06-16 12:16:29 UTC,
 @highest_post_number=2,
 @last_read_post_number=1,
 @notification_level=3,
 @topic_id=21328,
 @user_id=1071469>, ....]

(Sam Saffron) #2

It’s for unread and new count tracking without it you need to run multiple queries