Giter VIP home page Giter VIP logo

Comments (6)

erikjohnston avatar erikjohnston commented on August 15, 2024

Looks like the push API already supports setting a priority on a notification (prio field). It defaults to high, so we should check that:

  1. Sygnal correctly sets the priority on FCM based on the field, and
  2. Ensure that Synapse is correctly sending that, including when its set to only send the event_id to Sygnal.

from sygnal.

reivilibre avatar reivilibre commented on August 15, 2024

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.

erikjohnston avatar erikjohnston commented on August 15, 2024

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.

reivilibre avatar reivilibre commented on August 15, 2024

matrix-org/synapse#7765 should solve this as a temporary solution

from sygnal.

reivilibre avatar reivilibre commented on August 15, 2024

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.

richvdh avatar richvdh commented on August 15, 2024

yeah, I think we can close this.

from sygnal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.