Fix incorrect latest_id value in notifications_read request
The issue is well described here: #305 (closed).
Notifications are not correctly marked as read due to FE sending incorrect latest_id
.
A small screencast demonstrating the bug: https://cl.ly/094a2fcac2b0
The reason latest_id
is not always correct is that in addNewNotifications
, where we set maxId
by comparing notification ids, notification ids are compared as strings. So, for instance, id '9'
is greater than id '25'
.
As a side note, notification ids are explicitly converted to strings in parseNotification
after they are fetched from BE.
I haven’t looked at other parts of the code to see if there is anything that depends on them being strings, but since they are explicitly cast, I wasn’t considering changing this behavior as a part of the fix. (But please let me know if you think otherwise.)
Screencast with the bug fixed: https://cl.ly/0c437171ce03