No cloud push messages on iOS in Tigase-based apps

37 views
Skip to first unread message

sirrosh69

unread,
Feb 15, 2023, 12:37:33 PM2/15/23
to Prosody IM Users
Hi everyone!

Seems like nobody's complaining about not getting cloud push notifications on iOS in Siskin or Snikket XMPP clients. Could anyone verbally confirm, that _he_ has current Prosody 11 and Snikket (Siskin) works for him?

Got a Prosody server (opesSUSE packaging) up and running with all required modules (even tried "snikket_ios_preserve_push" and "snikket_client_id"), everything updates regulary. Conversations works like a charm, desktop and browser apps too. But iOS apps work only while being in focus or shortly after.

Push server registers successfully, but nothing comes through after Prosody logs "Client disconnected: connection closed" for this particular client.

Any ideas?

sirrosh69

unread,
Feb 15, 2023, 12:46:08 PM2/15/23
to Prosody IM Users
Just an update, when sending messages to "disconnected" Tigase clients this appear in logs:

cloud_notify    info    event.origin.push_identifier: nil
cloud_notify    info    Invoking cloud handle_notify_request() for offline stanza


Any ideas?

Matthew Wild

unread,
Feb 15, 2023, 2:10:25 PM2/15/23
to prosod...@googlegroups.com
I'd recommend updating to a more recent version (0.12.x) if possible.
I don't know if that's the cause of your issue, but it's hard to
remember what bugs have been fixed (so many!) since that version was
released.

It would also be helpful to ensure:

- You are running the latest version of mod_cloud_notify and
mod_cloud_notify_encrypted
- You have installed the necessary dependencies (luaossl)
- You have the latest version of Siskin

If all of the above seem correct, enable debug logging and check what
gets logged when you send a message to a disconnected Siskin client.

Regards,
Matthew

sirrosh69

unread,
Feb 15, 2023, 4:22:26 PM2/15/23
to prosod...@googlegroups.com
Thanks for the suggestions, the last thing I didn't try was updating to the latest Prosody, since it would be out of system's package management, so it won't be smooth and flawless.

I did track this issue and the key point (as from my perspective) is that the iOS client sends disconnect (as shown above) when the app goes asleep. After that cloud_notify clears push identifier, then later on processing stanzas for this user it treats the user as offline and the handle_notify_request() exits prematurely on checking push_identifier against nil.
When you intentionally drop the disconnect event (yes, I have tested this dirty hack) everything is starting to work as it should and  iOS push notifications work flawlessly.

As for the initial question: do you (personally) have any experience with iOS clients on your system?

st 15. 2. 2023 v 20:10 odesílatel Matthew Wild <mwi...@gmail.com> napsal:
--
You received this message because you are subscribed to a topic in the Google Groups "Prosody IM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prosody-users/gGK1KQWPdNY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prosody-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/prosody-users/CAJt9-x5KNPeJZyj2%2BwJbpTdXPsKnzZc4seGWfWuacaCS2Te6PA%40mail.gmail.com.

Matthew Wild

unread,
Feb 15, 2023, 5:05:04 PM2/15/23
to prosod...@googlegroups.com
On Wed, 15 Feb 2023 at 21:22, sirrosh69 <sirr...@gmail.com> wrote:
>
> Thanks for the suggestions, the last thing I didn't try was updating to the latest Prosody, since it would be out of system's package management, so it won't be smooth and flawless.
>
> I did track this issue and the key point (as from my perspective) is that the iOS client sends disconnect (as shown above) when the app goes asleep. After that cloud_notify clears push identifier, then later on processing stanzas for this user it treats the user as offline and the handle_notify_request() exits prematurely on checking push_identifier against nil.
> When you intentionally drop the disconnect event (yes, I have tested this dirty hack) everything is starting to work as it should and iOS push notifications work flawlessly.

Where do you see the push identifier is getting cleared? I skimmed
mod_cloud_notify and I only see two cases where it is cleared: 1) when
the client requests to disable push notifications, 2) when too many
errors have been received from the push server. I can't see that
mod_cloud_notify handles client disconnect events at all.

> As for the initial question: do you (personally) have any experience with iOS clients on your system?

Yes, Snikket uses these modules and the Snikket iOS app is based on Siskin.

Regards,
Matthew

Polarian

unread,
Feb 16, 2023, 1:22:45 AM2/16/23
to prosod...@googlegroups.com
Hello,

I can confirm that siskin IM and prosody with post notifications work.

Have a good evening,
--
Polarian
GPG signature: 0770E5312238C760
Website: https://polarian.dev
JID/XMPP: pola...@polarian.dev
OpenPGP_signature

sirrosh69

unread,
Feb 16, 2023, 4:08:19 AM2/16/23
to Prosody IM Users
That's awesome!!!

Do you use the latest version or packaged by the os' distro?
Could you please do me a favour showing your config?!

Dne čtvrtek 16. února 2023 v 7:22:45 UTC+1 uživatel pola...@polarian.dev napsal:

sirrosh69

unread,
Feb 16, 2023, 5:30:46 AM2/16/23
to prosod...@googlegroups.com
Thanks a lot, Matthew, for joining!

Just double-checked everything: having Prosody 0.12.1 on Lua 5.1 here, pulled the latest hg update.
The debug session looks like this (Bob has an iPhone with Siskin, Alice uses Conversations):

Feb 16 10:47:43 xmpp.eu:saslauth     info    Accepting SASL EXTERNAL identity from push.tigase.im
Feb 16 10:47:43 s2sin55603bc60380       debug   connection push.tigase.im->xmpp.eu is now authenticated for push.tigase.im
Feb 16 10:47:43 s2sin55603bc60380       info    Incoming s2s connection push.tigase.im->xmpp.eu complete
Feb 16 10:47:43 s2sin55603bc60380       debug   Incoming s2s received <stream:stream from='push.tigase.im' to='xmpp.eu' version='1.0' xmlns='http://etherx.jabber.org/stre
ams'>
Feb 16 10:47:43 s2sin55603bc60380       debug   Sending[s2sin]: <?xml version='1.0'?>
Feb 16 10:47:43 mod_s2s debug   Sending stream features: <stream:features><dialback xmlns='urn:xmpp:features:dialback'/><c hash='sha-1' ver='+uuR98R2TQCucfMVNtIlMYGfkNA=' no
de='http://prosody.im' xmlns='http://jabber.org/protocol/caps'/><sm xmlns='urn:xmpp:sm:2'><optional/></sm><sm xmlns='urn:xmpp:sm:3'><optional/></sm></stream:features>
Feb 16 10:47:43 s2sin55603bc60380       debug   Sending[s2sin]: <stream:features>
Feb 16 10:47:43 s2sin55603bc60380       debug   Received[s2sin]: <iq type='result' to='b...@xmpp.eu/iPhone' from='push.tigase.im' id='7206CC11-3C46-4382-85CE-C08DFFDEAFB1' xml:lang='en'>
Feb 16 10:47:43 c2s55603ad8cb50 debug   Sending[c2s]: <iq type='result' to='b...@xmpp.eu/iPhone' from='push.tigase.im' id='7206CC11-3C46-4382-85CE-C08DFFDEAFB1' xml:lang='en'>
Feb 16 10:47:44 c2s55603ad8cb50 debug   Handled 23 incoming stanzas
Feb 16 10:47:44 c2s55603ad8cb50 debug   Received[c2s]: <iq id='8C9985CC-C481-40D5-A835-36DBECFFDBA1' type='set' xml:lang='en'>
Feb 16 10:47:44 c2s55603ad8cb50 debug   Attempting to enable push notifications
Feb 16 10:47:44 c2s55603ad8cb50 debug   No publish options in request
Feb 16 10:47:44 xmpp.eu:cloud_notify_encrypted       debug   Encrypted push notifications enabled
Feb 16 10:47:44 datamanager     debug   Removing empty cloud_notify datastore for user b...@xmpp.eu
Feb 16 10:47:44 c2s55603ad8cb50 info    Push notifications enabled for b...@xmpp.eu/iPhone (push.tigase.im<01#55786025BB7EC16AD4ED840CE09BCB906D482633D484A654C34092D733BE78DB)


Here we saw the s2s session established with our xmpp.eu and push.tigase.im, nothing eye-catching, right?

Feb 16 10:51:19 c2s55603b60b170 debug   c2s stream for b...@xmpp.eu/iPhone closed: session closed
Feb 16 10:51:19 c2s55603b60b170 debug   Destroying session for b...@xmpp.eu/iPhone (b...@xmpp.eu)
Feb 16 10:51:19 sessionmanager  debug   All resources of bob are now offline


Here Bob's iPhone falls asleep and sends disconnect (btw non-iOS clients don't do that).

Feb 16 10:52:29 c2s55603a1d82b0 debug   Archiving stanza: <message type='chat' xml:lang='en' from='al...@xmpp.eu/gHxxe65_0CUz' id='7A14C057-CC0C-43DF-B1DB-34B10A18F778' to='b...@xmpp.eu'> (body)
Feb 16 10:52:29 xmpp.eu:mam     debug   bob's rule for al...@xmpp.eu is (nil)
Feb 16 10:52:29 xmpp.eu:mam     debug   bob's default rule is true
Feb 16 10:52:29 xmpp.eu:mam     debug   Archiving stanza: <message type='chat' xml:lang='en' from='al...@xmpp.eu/gHxxe65_0CUz' id='7A14C057-CC0C-43DF-B1DB-34B10A18F778' to='b...@xmpp.eu'> (body)
Feb 16 10:52:29 xmpp.eu:storage_internal        debug   bob has 835 items out of 10000 limit in store archive
Feb 16 10:52:29 xmpp.eu:carbons debug   Skip carbons for offline user
Feb 16 10:52:29 xmpp.eu:cloud_notify    debug   Invoking cloud handle_notify_request() for offline stanza
Feb 16 10:52:29 xmpp.eu:storage_internal        debug   bob has 0 items out of 10000 limit in store offline
Feb 16 10:52:29 xmpp.eu:offline debug   Saved to offline storage: <message type='chat' xml:lang='en' from='al...@xmpp.eu/gHxxe65_0CUz' id='7A14C057-CC0C-43DF-B1DB-34B10A18F778' to='b...@xmpp.eu'>


Here Alice sends Bob a message, which goes to an offline storage and simultaneously handle_notify_request() was invoked (in bold). And you know what is happening inside this procedure? It ends here: if not #user_push_services then return pushes end
(simply added a "module:log" after "then" and it spits the string)

Why it behaves like this, I have no idea...




Matthew Wild

unread,
Feb 16, 2023, 6:04:59 AM2/16/23
to prosod...@googlegroups.com
On Thu, 16 Feb 2023 at 10:30, sirrosh69 <sirr...@gmail.com> wrote:
>
> Thanks a lot, Matthew, for joining!
>
> Just double-checked everything: having Prosody 0.12.1 on Lua 5.1 here, pulled the latest hg update.

Can you try with Lua 5.2 or higher?

> Feb 16 10:47:44 c2s55603ad8cb50 debug Attempting to enable push notifications
> Feb 16 10:47:44 c2s55603ad8cb50 debug No publish options in request
> Feb 16 10:47:44 xmpp.eu:cloud_notify_encrypted debug Encrypted push notifications enabled
> Feb 16 10:47:44 datamanager debug Removing empty cloud_notify datastore for user b...@xmpp.eu

This last line is suspect. I know that in the past there have been
compatibility issues with mod_cloud_notify and Lua 5.1, I don't
remember if they were resolved. This seems like a way that the issue
might manifest itself.

Regards,
Matthew

sirrosh69

unread,
Feb 16, 2023, 7:10:28 AM2/16/23
to prosod...@googlegroups.com
Matthew,

I'm so sorry for the lame question, but how? ;)
simply changing the interpreter name in prosodyctl and prosody to lua5.4 does not work...

/usr/bin/lua5.4: error loading module 'util.table' from file '/usr/lib64/prosody/util/table.so':
/usr/lib64/prosody/util/table.so: undefined symbol: lua_insert


čt 16. 2. 2023 v 12:05 odesílatel Matthew Wild <mwi...@gmail.com> napsal:
--
You received this message because you are subscribed to a topic in the Google Groups "Prosody IM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prosody-users/gGK1KQWPdNY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prosody-user...@googlegroups.com.

Matthew Wild

unread,
Feb 16, 2023, 7:17:04 AM2/16/23
to prosod...@googlegroups.com
On Thu, 16 Feb 2023 at 12:10, sirrosh69 <sirr...@gmail.com> wrote:
> I'm so sorry for the lame question, but how? ;)
> simply changing the interpreter name in prosodyctl and prosody to lua5.4 does not work...

Ah, your packages are compiled for a specific Lua version. We don't
provide OpenSUSE packages ourselves, so I'm afraid you'll need to
contact your package maintainer and tell them to update the package to
a newer Lua version (our Lua 5.1 support is deprecated).

Alternatively, build Prosody yourself (but if you're unfamiliar with
building software from source this can cause more problems than it
solves).

Regards,
Matthew

sirrosh69

unread,
Feb 16, 2023, 8:12:39 AM2/16/23
to prosod...@googlegroups.com
It works :)))

Outdated Lua was my problem, 5.4 fixed this issue. I built Prosody 12.2  from source after adapting paths and just had it manually overwritten... I know, it's a bad thing, but I locked the package updates and will do it manually from now on.

BTW calls won't ring on a sleeping iPhone, but AFAIK this is has to be fixed by allowing pushes with actual content (turn off substituting for "You have a message" stub), isn't is?

čt 16. 2. 2023 v 13:17 odesílatel Matthew Wild <mwi...@gmail.com> napsal:
--
You received this message because you are subscribed to a topic in the Google Groups "Prosody IM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prosody-users/gGK1KQWPdNY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prosody-user...@googlegroups.com.

Matthew Wild

unread,
Feb 16, 2023, 8:36:43 AM2/16/23
to prosod...@googlegroups.com
On Thu, 16 Feb 2023 at 13:12, sirrosh69 <sirr...@gmail.com> wrote:
>
> It works :)))
>
> Outdated Lua was my problem, 5.4 fixed this issue. I built Prosody 12.2 from source after adapting paths and just had it manually overwritten... I know, it's a bad thing, but I locked the package updates and will do it manually from now on.
>
> BTW calls won't ring on a sleeping iPhone, but AFAIK this is has to be fixed by allowing pushes with actual content (turn off substituting for "You have a message" stub), isn't is?

Call notifications should work, and no, you don't have to change
whether content is included - mod_cloud_notify_encrypted already does
that. Ensure you also have the other modules (listed here:
https://modules.prosody.im/mod_cloud_notify_extensions ).

On Siskin sometimes it may be necessary to re-register push
notifications if the server configuration has changed (e.g. from not
supporting the necessary extensions). You can do this in the app: Go
to Settings, tap on the account, disable push notifications. Then
disable the account, and wait 60 seconds. Then enable the account
again, and then enable push notifications again.

Hope this helps!

Regards,
Matthew

Polarian

unread,
Feb 16, 2023, 9:16:43 AM2/16/23
to prosod...@googlegroups.com
Hello,

Sorry for the late reply to the mailing list, I was asleep.

Can I confirm that post notifications are now working on your instance,
or do you still need help with this issue.

I would like to highlight I have recently submitted an issue related to
post notifications, so it would help if you would be able to backup my
issues to highlight a genuine issue instead of a single isolated issue,
please check the following link for more information:

https://github.com/tigase/siskin-im/issues/212

If you still need help please let me know, you are free to message me on
XMPP.

Thanks,
OpenPGP_signature

sirrosh69

unread,
Feb 16, 2023, 11:02:45 AM2/16/23
to prosod...@googlegroups.com
Thank you Matthew, Polarian!
You guys helped me a lot. 

čt 16. 2. 2023 v 15:16 odesílatel 'Polarian' via Prosody IM Users <prosod...@googlegroups.com> napsal:
--
You received this message because you are subscribed to a topic in the Google Groups "Prosody IM Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prosody-users/gGK1KQWPdNY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prosody-user...@googlegroups.com.

Polarian

unread,
Feb 16, 2023, 4:58:48 PM2/16/23
to prosod...@googlegroups.com
I assume that means everything is working.

Have a good night,
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages