Comments (6)
Looks like the push API already supports setting a priority on a notification (prio
field). It defaults to high, so we should check that:
- Sygnal correctly sets the priority on FCM based on the field, and
- Ensure that Synapse is correctly sending that, including when its set to only send the
event_id
to Sygnal.
from sygnal.
Sygnal appears to correctly set the priority on both APNs and FCM pushes, but the spec says that a missing prio
field should be treated as high
priority, and Synapse doesn't appear to ever set the prio
field [1].
from sygnal.
So. Having looked into this a bit (or should I say, had @reivilibre look into it π), it turns out that this is a bit of a can of worms, as: both Android and iOS want/require high priority push to trigger notifications on the device and not be ignored. Ideally this means that the server can figure out which events the client will display notifications for, and which they won't. This is complicated due to client side rules, such as decrypting e2e messages and then running the standard push rules on them.
(It's also worth noting that apps shouldn't be waiting for an API call to Synapse before displaying a notification, since e.g. a /sync
can take a long time to return and the OS can kill the push handling thread before it returns. I think the suggestion in the past has been to wait a few seconds and if the API hit still hasn't returned to display a generic "You've received a new message" notification, or something like that).
This leads me to the conclusion that we can't easily fix this properly without a larger reworking of the notification and push rule system. As such I'm inclined to do something a bit hacky here that simply reduces the number of high priority pushes we send out, rather than ensuring that only push that trigger notifications will be high priority. I guess the simplest proposal would be to add some cheeky logic to Synapse so that only encrypted events and those with sound/highlight tweaks get given a high priority. (Unfortunately this can't happen on Sygnal due to it not having access to the event types and such).
I would be inclined not to spec this and simply say that this is Synapse specific logic, mainly as this feels like a hack and leads to behaviour which is not really correct. Ideally we'd follow up on this issue with a proper fix that we can then spec.
from sygnal.
matrix-org/synapse#7765 should solve this as a temporary solution
from sygnal.
Should we now close this? This issue is a bit out of scope for Sygnal since it just does what it's told.
The hack we implemented is sad but realistic β anything more will need a rework of push rules (which is coming!) and perhaps broader push in generalβ¦
from sygnal.
yeah, I think we can close this.
from sygnal.
Related Issues (20)
- Push notification issue HOT 1
- Consider migrating to FCM HTTP v1 API [old API shutoff: June 2024] HOT 15
- "default_payload was misconfigured, this value must be a dict" error is noisy
- Not a bug, but a problem with the delivery of notifications to iOS HOT 2
- Install and setup Sygnal HOT 7
- iOS VOIP sometimes notifications do not work if app is not open/in background HOT 3
- iOS VOIP sometimes notifications getting significantly delayed if app is closed/in background HOT 19
- ios notification -fluffyChat HOT 2
- `binascii.Error: Invalid base64-encoded string: number of data characters (157) cannot be 1 more than a multiple of 4` when using FluffyChat HOT 5
- Add wget or curl in docker image for healthchecking in docker-compose
- Android, Apple and client cannot jump out the message. HOT 2
- IOS ringtone in Matrix Synapse installed using ansible? HOT 2
- Collapsing push messages for IOS HOT 1
- On Screen Calls IOS HOT 3
- FCM push for iOS issue HOT 2
- Web push notifications are not working with web.push.apple.com (Safari) HOT 3
- missing setup.py file HOT 3
- UnifiedPush support HOT 11
- Upgrade dependencies HOT 1
- Documentation for using Sygnal behind a reverse proxy HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sygnal.