Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages counters are disabled if notifications for group chats are disabled #528

Open
MRZA-MRZA opened this issue Mar 6, 2017 · 6 comments

Comments

@MRZA-MRZA
Copy link

MRZA-MRZA commented Mar 6, 2017

I don't need notifications for every single message in group chats. So I turned them off but counters for messages disappeared. I need to know number of unread messages per chat but I don't want to get spammed with notifications.

If desktop notifications is on and notifications for group chats is on there are counters present but I get unwanted notifications.
If desktop notifications is on and notifications for group chats is off no counters and no unwanted notifications.
I think there should be a way to see counters and receive notification only on mentioning.

@lampholder lampholder added P2 A-Notifications T-Defect S-Minor Impairs non-critical functionality or suitable workarounds exist labels Mar 9, 2017
@lampholder
Copy link
Member

I'm in two minds as to how to categorize this - it certainly seems unexpected that unread message count functionality would be coupled to notifications, so I'm leaning towards its being a bug.

Related: #1359 element-hq/element-web#3389. Could be tackled as part of #1359.

@ara4n
Copy link
Member

ara4n commented Mar 9, 2017

the current designed behaviour is "badge count shows number of missed notifs". I agree it could be useful though to have the count reflect messages even if you didn't get a notif for them though. This is a new feature tho.

@ara4n ara4n added P3 and removed P2 labels Mar 9, 2017
@albuic
Copy link

albuic commented Jun 29, 2017

+1 for decoupling the two

ara4n referenced this issue in matrix-org/synapse Sep 19, 2019
…ations

This is a potential solution to https://github.com/vector-im/riot-web/issues/3374
and element-hq/element-web#5953
as raised by Mozilla at element-hq/element-web#10868.

This lets you define a push rule action which increases the badge count (unread notification)
count on a given room, but doesn't actually send a push for that notification via email or HTTP.
We might want to define this as the default behaviour for group chats in future
to solve https://github.com/vector-im/riot-web/issues/3268 at last.

This is implemented as a string action rather than a tweak because:
 * Other pushers don't care about the tweak, given they won't ever get pushed
 * The DB can store the tweak more efficiently using the existing `notify` table.
 * It avoids breaking the default_notif/highlight_action optimisations.

Clients which generate their own notifs (e.g. desktop notifs from Riot/Web
would need to be aware of the new push action) to uphold it.

An alternative way to do this would be to maintain a `msg_count` alongside
`highlight_count` and `notification_count` in `unread_notifications` in sync responses.
However, doing this by counting the rows in `events` since the `stream_position`
of the user's last read receipt turns out to be painfully slow (~200ms), perhaps
due to the size of the events table.  So instead, we use the highly optimised
existing event_push_actions (and event_push_actions_staging) table to maintain
the counts - using the code paths which already exist for tracking unread
notification counts efficiently.  These queries are typically ~3ms or so.

The biggest issues I see here are:
 * We're slightly repurposing the `notif` field on `event_push_actions` to
   track whether a given action actually sent a `push` or not.  This doesn't
   seem unreasonable, but it's slightly naughty given that previously the
   field explicitly tracked whether `notify` was true for the action (and
   as a result, it was uselessly always set to 1 in the DB).
 * We're going to put more load on the `event_push_actions` table for all the
   random group chats which people had previously muted. In practice i don't
   think there are many of these though.
 * There isn't an MSC for this yet (although this comment could become one).
@ara4n ara4n added P1 and removed P3 labels Sep 25, 2019
@Biep
Copy link

Biep commented Jan 27, 2020

The current set-up breaks Kent Pitman's two-bit rule.

@Knebergish
Copy link

Hello all!
It looks like the problem is still relevant at the moment, and I don't see any way to enable the unread message counter without enabling notifications.
The only solution for me is to disable notifications for Element in the KDE Plasma settings - so I don't get notifications on the desktop, but I have a counter in the application. But because of this, I lose the opportunity to receive notifications about really important events, such as personal messages or mentions.
Are there any plans to fix it? This problem reminds me of itself every day, and I would be incredibly glad to hear that some work is already in progress to fix it.

@t3chguy
Copy link
Member

t3chguy commented Aug 1, 2022

This is a spec issue, the server-side (unread) notification counters are not provided when you disable notifications (because they're notification counters after all)

@t3chguy t3chguy transferred this issue from element-hq/element-web Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests