Notification 'Read!' doesn't set value true in "seen"-column in database
- Have a user with unread notifications and run (1). You'll notice column
"seen"=false
=> Ok - When click Read! the notifications are marked as read on the FE => Ok
- When closing and reopening the tab, the notifications are still marked as read on the FE => Ok
- However, when you run (1) again, you'll see it's still
"seen"=false
=> Not Ok - When you clear website data in the browser and you reload the page (or use private window or use another browser...), it's unread again => Not Ok
When I set the flags in the database to seen=true
(you can run (2) for this) the notifications are shown as read even after clearing browserdata, so it seems that reading from the database works, just not storing to the database.
The reason why I noticed it is 'cause I've got my browser set to clear cookies and browserdata by default when closing my browser.
(1) Change <username>
to relevant Username
select * from notifications
where user_id=(select id from users where "nickname"='<username>')
order by id desc
(2) Change <username>
to relevant Username
-- set notifications to read
update notifications set seen=true
where user_id in (
select id from users
where local = true
and seen=false
and nickname in ('<username>'));