Files
mostlymatter/api4
Kyriakos Z b15cd9d29f MM-41565,MM-42473: fixes incorrect unread thread count (#19962)
* MM-41565,MM-42473: fixes incorrect unread thread count

The infamous "-1 unread threads" bug, was due to incorrectly counting
previous unread mentions and replies.

When we calculate the previous counts, we didn't take into account if
a thread was newly followed one or not. So when a user gets added to a
thread via a mention receives a WS event with the previous count values
calculated by subtracting "1" from the current count values.
In the result the webapp subtracts the previous values for the thread
from the total values of all threads for the user.

This is wrong since the user just followed the thread those previous values
should be 0. Which results into showing a negative value of unread
threads to the user.

This commit fixes this issue by zeroing the previous count values when
the user was not following the thread previously.

* Adds test, and addresses comments

* Changes test's description

* Removes unneeded assertion

* Empty commit just to re-build
2022-04-15 12:47:04 -04:00
..
2022-02-28 15:01:00 +05:30
2021-09-01 14:43:12 +02:00
2022-04-11 19:31:19 +05:30
2022-02-28 15:01:00 +05:30
2022-04-11 20:51:33 +05:30
2021-09-01 14:43:12 +02:00
2021-08-17 16:08:04 -04:00
2022-02-28 15:01:00 +05:30
2022-04-11 19:31:19 +05:30