spreed icon indicating copy to clipboard operation
spreed copied to clipboard

Chats often show the unread message counter, is it related to reactions?

Open nickvergessen opened this issue 3 years ago • 2 comments

nickvergessen avatar May 05 '22 14:05 nickvergessen

Can I ask reproduce steps for this?

nikola-gladovic avatar May 19 '22 17:05 nikola-gladovic

No steps sadly. I assume it is from the hidden reaction system messages or something like that.

nickvergessen avatar May 20 '22 08:05 nickvergessen

Since it just happened for me I looked it up and the issue is indeed related to reactions.

My read-marker is set to 1432790 and that is a reaction message:

SELECT * FROM oc_comments WHERE id = 1432790;
+---------+-----------+-------------------+----------------+------------+----------+---------+----------+---------------------+------------------------+-------------+-----------+--------------+-----------+-------------+
| id      | parent_id | topmost_parent_id | children_count | actor_type | actor_id | message | verb     | creation_timestamp  | latest_child_timestamp | object_type | object_id | reference_id | reactions | expire_date |
+---------+-----------+-------------------+----------------+------------+----------+---------+----------+---------------------+------------------------+-------------+-----------+--------------+-----------+-------------+
| 1432790 |   1432559 |           1432559 |              0 | users      | …   | ❤️      | reaction | 2022-10-02 07:19:22 | NULL                   | chat        | 5630      | NULL         | NULL      | NULL        |
+---------+-----------+-------------------+----------------+------------+----------+---------+----------+---------------------+------------------------+-------------+-----------+--------------+-----------+-------------+

After some digging through the code:

  • Reaction messages are returned on the API and saved in the store
  • But reactions are not rendered in the UI
  • So in that case: https://github.com/nextcloud/spreed/blob/ad0646821c6a6e4732e214bb32498247bd286176/src/components/MessagesList/MessagesList.vue#L723-L730 is null
  • So this code here is bailing out and we don't set the readmarker: https://github.com/nextcloud/spreed/blob/ad0646821c6a6e4732e214bb32498247bd286176/src/components/MessagesList/MessagesList.vue#L757-L762
  • To summarize, the problem are reactions, but not the new unread reactions but the last already read reaction

nickvergessen avatar Oct 02 '22 10:10 nickvergessen