DEV: Remove unused attributes when publishing read/new.

DEV: Remove unused attributes when publishing read/new.

diff --git a/app/assets/javascripts/discourse/tests/unit/models/topic-tracking-state-test.js b/app/assets/javascripts/discourse/tests/unit/models/topic-tracking-state-test.js
index 83cf49e..c910a3c 100644
--- a/app/assets/javascripts/discourse/tests/unit/models/topic-tracking-state-test.js
+++ b/app/assets/javascripts/discourse/tests/unit/models/topic-tracking-state-test.js
@@ -417,7 +417,6 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
         topic_id: 111,
         message_type: "unread",
         payload: {
-          topic_id: 111,
           category_id: 123,
           topic_tag_ids: [44],
           tags: ["pending"],
@@ -479,7 +478,6 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
         assert.deepEqual(
           trackingState.findState(111),
           {
-            topic_id: 111,
             category_id: 123,
             topic_tag_ids: [44],
             tags: ["pending"],
@@ -543,7 +541,6 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
           message_type: "read",
           topic_id: 112,
           payload: {
-            topic_id: 112,
             last_read_post_number: 4,
             highest_post_number: 4,
             notification_level: NotificationLevels.TRACKING,
@@ -575,7 +572,6 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
         topic_id: 222,
         message_type: "new_topic",
         payload: {
-          topic_id: 222,
           category_id: 123,
           topic_tag_ids: [44],
           tags: ["pending"],
@@ -648,7 +644,6 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
         assert.deepEqual(
           trackingState.findState(222),
           {
-            topic_id: 222,
             category_id: 123,
             topic_tag_ids: [44],
             tags: ["pending"],
@@ -764,17 +759,17 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 1,
-      payload: { category_id: 2, topic_id: 1 },
+      payload: { category_id: 2 },
     });
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 2,
-      payload: { category_id: 3, topic_id: 2 },
+      payload: { category_id: 3 },
     });
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 3,
-      payload: { category_id: 1, topic_id: 3 },
+      payload: { category_id: 1 },
     });
 
     assert.equal(
@@ -789,17 +784,17 @@ discourseModule("Unit | Model | topic-tracking-state", function (hooks) {
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 1,
-      payload: { category_id: 2, topic_id: 1 },
+      payload: { category_id: 2 },
     });
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 2,
-      payload: { category_id: 3, topic_id: 2 },
+      payload: { category_id: 3 },
     });
     trackingState.notifyIncoming({
       message_type: "new_topic",
       topic_id: 3,
-      payload: { category_id: 1, topic_id: 3 },
+      payload: { category_id: 1 },
     });
 
     assert.equal(
diff --git a/app/models/topic_tracking_state.rb b/app/models/topic_tracking_state.rb
index 15199c9..e5ea071 100644
--- a/app/models/topic_tracking_state.rb
+++ b/app/models/topic_tracking_state.rb
@@ -52,7 +52,6 @@ class TopicTrackingState
       last_read_post_number: nil,
       highest_post_number: 1,
       created_at: topic.created_at,
-      topic_id: topic.id,
       category_id: topic.category_id,
       archetype: topic.archetype,
       created_in_new_period: true
@@ -237,7 +236,6 @@ class TopicTrackingState
       payload: {
         last_read_post_number: last_read_post_number,
         highest_post_number: highest_post_number,
-        topic_id: topic_id,
         notification_level: notification_level
       }
     }

GitHub sha: e1579253082b0ed270b8e38d3d0033c2d3071358

This commit appears in #13968 which was approved by martin. It was merged by tgxworld.