Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Defaults for 1:1 chat notifications are not obeyed for Android push notifications #2537

Open
PaulosV opened this issue Jun 20, 2022 · 6 comments
Labels
C-User-API F-Push T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@PaulosV
Copy link

PaulosV commented Jun 20, 2022

Background information

  • Dendrite version or git SHA: 0.8.8
  • Monolith or Polylith?: Monolith
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: Yes
  • Client used (if applicable): Element (Android) 1.4.16 [40104162] (G-b8288) ; SchildiChat 1.4.20.sc55 [40100880] (G-776afd86)

Description

  • What is the problem: No push notifications are sent for one-to-one chats with room notification settings set to "Default". Defaults for one-to-one chat notifications in Element client are set to "Noisy".
  • Who is affected: Me.
  • How is this bug manifesting: On Android, I get no notification for 1:1 chats when the Android app is in the background. I get the notifications when I manually set the chat notifications to "All messages", OR if I set the group messages defaults to "On / Noisy".
  • When did this first appear: Don't know. Noticed it on 2022-06-19.

Steps to reproduce

  • Login to your Dendrite homeserver on your Android phone.
  • In your client, set these defaults in settings - 1:1 chat notifications to On / Noisy, and Group chat notifications to Off.
  • Create a 1:1 chat with someone.
  • Set room notification settings to Default.
  • Ensure that your desktop client is not running / is not in focus.
  • Ask the other user to send you a message.

The Android client in the background gets no notification. It should have gotten something. It receives all the notifications when it goes back in the foreground.

@PaulosV PaulosV changed the title Defaults for 1:1 chat notifications are not obeyed for push notifications Defaults for 1:1 chat notifications are not obeyed for Android push notifications Jun 20, 2022
@jittygitty
Copy link

@PaulosV Try a trigger to populate the notifications rules, such as for element android see: element-hq/element-android#6115 (comment)
and #2484

@S7evinK
Copy link
Contributor

S7evinK commented Oct 20, 2022

Possibly related to Dendrite not sending the notification count to the push gateway - should be fixed by #2683.
Does this still happen? If so, it may also be related to the push gateway (default matrix.org) being overloaded and takes some time to process everything.

@S7evinK S7evinK added C-User-API possibly-fixed Needs some confirmation but this issue may already be resolved labels Oct 20, 2022
@PaulosV
Copy link
Author

PaulosV commented Oct 20, 2022

@PaulosV Try a trigger to populate the notifications rules, such as for element android see: vector-im/element-android#6115 (comment) and #2484

I was trying to work out how to populate the rules, but I have tried to turn the notifications off and on several times, and the notifications rules were definitely present. And the notifications eventually worked, but not for the mentioned 1:1 chats.

Possibly related to Dendrite not sending the notification count to the push gateway - should be fixed by #2683. Does this still happen? If so, it may also be related to the push gateway (default matrix.org) being overloaded and takes some time to process everything.

I'll check but when I set the notifications to "All messages", it worked, so it was really something wrong with the "default" option - the original Element for Android did not have that option for 1:1 chats, instead there was an "All messages" and "None".
I also don't think it was a problem with overload, when the notification did come, it was instant, and when it did not come, it has never come after.

@S7evinK
Copy link
Contributor

S7evinK commented Oct 20, 2022

Ah, okay.
Just remembered that there was #2705, which tweaked the 1:1 notification actions for encrypted rooms.
If it's still not working, it may be necessary to recreate the default rules provided by Dendrite. This can be done by deleting them from the database:

DELETE FROM userapi_account_datas WHERE type = 'm.push_rules' AND localpart = '$yourUserLocalpart'

They will be recreated on the next notification. You'll need to do an initial sync after that, so Element Android fetches the newly created rules.

If you say "All messages" and "None", those seem to be the normal options for encrypted rooms.

@PaulosV
Copy link
Author

PaulosV commented Oct 22, 2022

Thanks for the tips, I've tried to update Dendrite to 0.10.4, removed the rules from the database, signed out and back in, and created an entirely new 1:1 E2E-encrypted direct messaging (it's over federation, btw). Still no push notifications in my SchildiChat (Android) without manually changing to "All messages" in the menu.

Edit: The 1:1 conversation was created via federation from Element on desktop.

@PaulosV
Copy link
Author

PaulosV commented Oct 22, 2022

Actually, here's the interesting part now.

When I create the conversation on my Dendrite homeserver - either rfrom my SchildiChat Android, or the Element on desktop, then the notifications are set up correctly and they work on my Android! The SchildiChat client still shows "Default" for the notification settings, but it works.

But when I do it the other way around - I create the channel on the other end of the federation (Synapse homeserver), then I get no push notifications at Dendrite unless I change the setting from "Default" to "All notifications".

@kegsay kegsay added F-Push T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. and removed possibly-fixed Needs some confirmation but this issue may already be resolved labels Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-User-API F-Push T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

4 participants