spreed icon indicating copy to clipboard operation
spreed copied to clipboard

Notifications not removed from database after joining

Open SystemKeeper opened this issue 1 year ago • 8 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. UserA sends message to UserB
  2. Confirm notification is in DB
  3. UserB joins the conversation -> message is marked read

Expected behaviour

The notification for the message send by UserA to UserB should be removed from the database

Actual behaviour

The notification is still in the database. I also assume that the "send silent push to indicate that the notification was removed" is also not triggered.

It does work though, if the page is reloaded and then the conversation is joined.

https://github.com/nextcloud/spreed/assets/1580193/f2fa95bd-ec1b-48d4-aaee-695b1450b85f

Talk app

Talk app version: main

Browser

Operating system: MacOS 14.1.2

Browser name: Chrome

Browser version: 119

SystemKeeper avatar Dec 05 '23 09:12 SystemKeeper

We tried to improve this with https://github.com/nextcloud/spreed/pull/10889

https://github.com/nextcloud/spreed/blame/f2f5e4b393327592f8f8047b8123c3e0e0971748/lib/Notification/Listener.php#L137-L140

nickvergessen avatar Dec 05 '23 14:12 nickvergessen

Is it reactions you are seeing (like me) or any notifications?

nickvergessen avatar Dec 05 '23 14:12 nickvergessen

Is it reactions you are seeing (like me) or any notifications?

The test above was with a normal chat message

SystemKeeper avatar Dec 05 '23 15:12 SystemKeeper

I think it's due to the change in https://github.com/nextcloud/spreed/pull/10544, where we set markNotificationsAsRead always to 0:

https://github.com/nextcloud/spreed/blob/06af15480324de78c7f4e5365e2164a9921794b6/src/services/messagesService.js#L72-L72

To improve the situation I think it makes sense to set the parameter depending on the session state? So 1 in case the session is active?

SystemKeeper avatar Feb 10 '24 20:02 SystemKeeper

Well that is up to 30 seconds delayed due to long running requests atm.

nickvergessen avatar Feb 10 '24 21:02 nickvergessen

But still would remove existing notifications for that conversation as soon as we receive a message ?

SystemKeeper avatar Feb 10 '24 21:02 SystemKeeper

But not when the user is no longer looking at it

nickvergessen avatar Feb 12 '24 15:02 nickvergessen

But not when the user is no longer looking at it

Right... So should we add a parameter to the mark as read endpoint so the web could remove notifications when doing mark as read when the session is active?

SystemKeeper avatar Feb 12 '24 15:02 SystemKeeper