prosody: Client not woken up by push notification after going offline (#416)
Unknown opened 5 years ago

Describe the bug

First of all, this could be caused either by prosody not properly processing and sending push events or by Siskin.im not properly registering as a push service. So this needs expertise from both sides.

After Siskin.im gets terminated in the background and thus disconnects from the server, it is not properly woken up when new messages arrive. Push messages have been activated in the account settings.

To Reproduce Steps to reproduce the behavior:

  1. Connect a siskin.im iOS client to a prosody with mod_cloud_notify and mod_smacks enabled
  2. Enable push notifications in the client's account settings.
  3. Write a message to that account while it is still online and observe the debuglog to see mod_cloud_notify working and connecting to push.tigase.im
  4. Put the client into background an wait for it to (forcibly) go offline.
  5. Write another message to the account.

Expected behavior The suspended client should be woken up by a push message and reconnect.

Smartphone (please complete the following information):

  • Device: iPhone 8+
  • OS: iOS 13.4.1

Additional context

The bug report on the prosody side contains detailed server logs for this issue. https://issues.prosody.im/1544

Unknown commented 5 years ago

Siskin IM does not reconnect upon receiving push notifications. Instead, it displays notification containing details related to the notification which were sent in the push notification. Then, if users tap on the notification, Siskin IM starts and reconnects to the XMPP server.

This behavior was chosen by us to reduce the amount of energy used by the app, as each reconnection consumes energy.

Unknown commented 5 years ago

@hantu85 Oh, that's good to know. It'd be nice to be able to configure this behaviour though, in case you do not want to leak metadata to the centralised push service by including the sender into the push notification.

Additionally the prosody logs look like not even this push notification is being sent. I'm still awaiting feedback on my Prosody bug report though.

Unknown commented 5 years ago

If push notifications could not be enabled (ie. Prosody would return an error) then Siskin would disable push notification for that account. But that would be visible in Siskin UI.

Unknown commented 5 years ago

I am just observing that the debug logging message supposed to appear when sending a push message never appears in the logs. I'll check the Siskin UI though as soon as I can get a hold of my user.

Unknown commented 5 years ago

I do not think that we would change behavior of push notifications as reconnection upon receiving each notification is a waste of energy. As for privacy, Tigase XMPP Server offers encrypted push notifications. In this case, Siskin sends AES128GCM key to the server and the server sends encrypted metadata of the message to the client using APNS. More details about this feature available at https://tigase.github.io/tigase-xeps/docs/push-notifications/encrypt/

Unknown commented 5 years ago

Okay, also a valid trade-off. Are you considering to bring this XEP proposal to the XSF, or do you consider it to be a unique selling point of your home-grown ecosystem?

Unknown commented 5 years ago

I've already talked at the XMPP Summit about that and we would like to make it a standard feature. However, there were some concerns related to the usage of JSON in the payload.

Unknown commented 5 years ago

So far it looks like the issue was server-side, so I'll close it for now. For reference, people should try to run prosody with lua5.2 instead of 5.1.

Unknown commented 5 years ago

@hantu85 Just out of interest, how do you handle incoming JINGLE calls when the app is not woken up? Does iOS have a dedicated push notification for voice calls?

Unknown commented 5 years ago

Currently, we do not accept calls while the app is not active, but we are working on a solution for that with a custom extension (it is required) and a specialized push for iOS.

Unknown commented 4 years ago

Hello! The problem is in the application. 10-15 seconds after the screen turns off, push notifications stop coming. In other applications example: Chatsecure, there is no problem. I have version of lua5.2....(

Unknown commented 4 years ago

Do you have an entry in your push database for push.tigase.im ? You have s2s enabled?

Unknown commented 4 years ago

Do you have an entry in your push database for push.tigase.im ? You have s2s enabled?

Yep i'm saw in logs push.tigase.im and chatsecure two, but chatsecure is work push, siskin - no. s2s enabled and required.

Unknown commented 4 years ago

I'm tested Siskin 6.2 on iOS 12.5.1 Iphone 5s and push is working after 10-60 minutes and more after disabled "csi_battery_saver"; module in Prosody conf.

But on Iphone 11 ios 13, Siskin 6.2 this is not help. After that i'm upgraded to iOS 14.4 and this not help two.

In logs i'm finded: NOT invoking cloud handle_notify_request() for newly smacks queued stanza (session.push_identifier is not set: <nil>) when send to Iphone 11 and he sleep.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#416
Please wait...
Page is in error, reload to recover