Message not being fetched after post notification (#572)
Open
Unknown opened 2 years ago

Describe the bug Message is not fetched after post notification is received from the XMPP server.

Note: This is submitted on the behalf of someone who uses IOS, they are not fluent with github and thus I have to deal with this.

To Reproduce Steps to reproduce the behavior:

  1. Close your phone and ensure that siskin has disconnected from the server (apple prevents background tasks)
  2. Wait for a friend to message you
  3. Receive a post notification from the server saying you have new messages.
  4. Open siskin, but the messages are never fetched, siskin has identified there is new messages but never actually fetches them after a post notification is received for the message.

As a sidenote, these messages are NEVER fetched, reloading the client, trying to force it to fetch the messages does not work, siskin believes the message already exists client side... (this is what I assume due to the behaviour)

Expected behavior When you receive a post notification warning you there is new messages, you should open siskin and see the messages which you have missed be pulled from the history.

Details (please complete the following information):

  • Siskin Version: 7.3.2
  • iOS version Unknown
  • iPhone model Unknown

Additional context I am the XMPP server provider for the user, I run latest version of prosody, using the push notification module.

Unknown commented 2 years ago

This might be related to issue #554 but as the push notifications work, I do not think so...

Unknown commented 2 years ago

I do not think this is related to issue #554 as notifications are working fine, however, it looks like retrieval of messages from the archive on the server side does not work properly.

Could you check on the server side if in logs there are any errors related to the retrieval of messages from this user's MAM archive? or even if there are any requests to fetch those messages? (from Siskin on this account)

I'm assuming that MAM:2 is supported by prosody and enabled on your installation, is that correct?

Unknown commented 2 years ago

@hantu85 So,

Firstly I do not own the iphone, so this is harder for me to verify, yes ideally I would get the person who is having the issue to report it but they got no clue how this all works unfortunately.

Secondly, MAM is enabled, and it is defaultly enabled on prosody, my prosody instance is up to date so this should not be the issue.

Thirdly, I have checked the logs, there seems to be no server side issues when it comes to the persons account, or them fetching the messages. I do not log messages or requests, only the connection information and errors associated with it, so I can not tell you whether their client is attempting to fetch these messages or not, sorry about this.

Unknown commented 2 years ago

@PolarianDev is MAM enabled in Siskin too?

Unknown commented 2 years ago

I can not verify this, I will need to ask.

Please give me the path within the settings to this option and I will ask the user whether they have this enabled.

Unknown commented 2 years ago

@PolarianDev

Account -> Message Archiving -> Automatic synchronization: enabled (was: disabled) Account -> Message Archiving -> Synchronization: 7 days

Unknown commented 2 years ago

Update: still waiting on user to reply back with his configuration before we can proceed.

Unknown commented 2 years ago

@licaon-kter Siskin IM version 7.3.2 (just check their phone).

The following you have listed under account does not exist, there is message archiving but its enabled and there is no synchronisation option...

As MAM is enabled, both server and client side, I guess this is a siskin issue still!

Unknown commented 2 years ago

Was this account newly added to Siskin IM? Do your user exchanged any message with this account using Siskin IM before? (ie. sent or received a message using Siskin by opening a chat and sending or receiving a message?) or this is just a new install and Siskin IM was never used to send or receive a message?

If there are no messages in Siskin IM, I would suggest to try to send a message from Siskin and check if after that anything changes. Knowing the result of that would help us with solving this issue.

Unknown commented 2 years ago

The account existed before I had enabled Push Notifications on my server. Then the user enabled push notifications.

The account is not new, I made it months ago, it existed before Push Notifications were supported server side... maybe this could be the issue?

Unknown commented 2 years ago

I checked the enabled modules, MAM is not showing up, it shows up in Gajim and every other xmpp clients... you sure MAM is working in upstream?

Unknown commented 2 years ago

MAM works just fine in Siskin IM for me and I'm using it daily (always newest version, very often unreleased beta versions).

The account existed before I had enabled Push Notifications on my server. Then the user enabled push notifications.

I was not asking if account is new, but is it newly added to Siskin IM. Because if it is, then Siskin IM has no messages in its local storage for this account and that could change how MAM would be triggered.

Unknown commented 2 years ago

I checked the enabled modules, MAM is not showing up, it shows up in Gajim and every other xmpp clients... you sure MAM is working in upstream?

How you checked that it is not showing up? There are no MAM requests going to the server from the client?

Unknown commented 2 years ago

How you checked that it is not showing up? There are no MAM requests going to the server from the client?

Like I said previously I do not log MAM requests server side, as it is privacy invasive.

I was not asking if account is new, but is it newly added to Siskin IM. Because if it is, then Siskin IM has no messages in its local storage for this account and that could change how MAM would be triggered.

Sorry I misunderstood, the account has been in use for a few months, so it should have quite a few messages stored in the database... It has also sent multiple messages to my JID too...

Unknown commented 2 years ago

Does siskin IM have logging enabled?

Unknown commented 2 years ago

It has logging but you would need to attach it to macOS to access logs as they are stored natively in side iOS logging mechanism (accessible using macOS Console app).

Unknown commented 2 years ago

How you checked that it is not showing up? There are no MAM requests going to the server from the client? Like I said previously I do not log MAM requests server side, as it is privacy invasive.\

Logging stanzas/requests is privacy invasive however logging simple informations like the fact that messages are being requests for account wouldn't be in my opinion, but I understand that you do not want to log anything related to MAM.

However, you stated that MAM is not showing up,

I checked the enabled modules, MAM is not showing up, it shows up in Gajim and every other xmpp clients... you sure MAM is working in upstream?

so I wondered where and how you checked that? Was it that just checking that client doesn't show history from MAM?

Unknown commented 2 years ago

It has logging but you would need to attach it to macOS to access logs as they are stored natively in side iOS logging mechanism (accessible using macOS Console app).

Well can't do that without a macbook :/

so I wondered where and how you checked that? Was it that just checking that client doesn't show history from MAM?

Within the acocunt settings there is supported xeps, MAM is not there...

Unknown commented 2 years ago

For now I would not relay on that as the list of XEPs and conditions that are used to check were not updated for a while now. However, it indicates status of MAM (XEP-0313, urn:xmpp:mam:2) quite well for me on Tigase XMPP Server, so it should also work well for Prosody.

Unknown commented 2 years ago

Hm, that is weird...

image

Gajim reports MAM as working, but for some reason Siskin does not...

Should I delete the account (from the client) and then add the account back again and see if it fixes it?

Unknown commented 2 years ago

That is weird as both clients are testing existence of MAM:2 on the server side. I wonder, if on the account view (in Siskin IM settings) account is enabled and has a green dot next to the avatar icon?

Unknown commented 2 years ago

Yes the account is enabled, they can send me messages, and receive messages when they have the client open, but when they get push notifications the messages are never fetched by Siskin when they load the client back up.

I do not believe this issue occurred when they did not have push notifications enabled, they would get no notifications (of course because ios kills background tasks), but they would fetch the messages when they reconnect, with Push Notifications this logic seems to be broken for some reason?

Unknown commented 2 years ago

I would not blame push notifications for that, as those are just indications for Siskin IM to show badge/alert notification on the screen and that is it. It has not impact on reconnection to the server, nor adding any entries to the database (so that the app could think that this message is already in the local storage).

Unknown commented 2 years ago

There is one more thing that could be checked. Is the time on the devices correct? (I assume it is, but I would like to verify that). I mean, is the time on the server correct (updated using ntp) and the time on the device also adjusted correctly?

Are both devices in the same time zone? (that is not needed but could indicate issues with timezone handing).

I'm asking that as Siskin sends timestamp of the last message it has in its local storage to the server to fetch only newer messages, so if date/time would be incorrect, it could lead to some message not being fetched from the server.

Unknown commented 2 years ago

I would not blame push notifications for that, as those are just indications for Siskin IM to show badge/alert notification on the screen and that is it. It has not impact on reconnection to the server, nor adding any entries to the database (so that the app could think that this message is already in the local storage).

Weird, you also do not want the push notification to contain the message content, as it is sent to apple servers and that would defeat the reason of using a decentralised protocol.

However I am not sure on why this has happened then?

Unknown commented 2 years ago

There is one more thing that could be checked. Is the time on the devices correct? (I assume it is, but I would like to verify that). I mean, is the time on the server correct (updated using ntp) and the time on the device also adjusted correctly?

Are both devices in the same time zone? (that is not needed but could indicate issues with timezone handing).

I'm asking that as Siskin sends timestamp of the last message it has in its local storage to the server to fetch only newer messages, so if date/time would be incorrect, it could lead to some message not being fetched from the server.

That is a good idea, if the time is out of sync it would definitely impact, I will check with the user now to make sure.

Both devices (the client and the server) are both within GMT+0

The issue is, they sometimes check their messages the next day and still do not get the message fetched from the server, which is why this is so weird.

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