Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message not being fetched after post notification #212

Open
PolarianDev opened this issue Feb 15, 2023 · 26 comments
Open

Message not being fetched after post notification #212

PolarianDev opened this issue Feb 15, 2023 · 26 comments
Assignees
Labels
bug Something isn't working

Comments

@PolarianDev
Copy link

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.

@PolarianDev PolarianDev added the bug Something isn't working label Feb 15, 2023
@PolarianDev
Copy link
Author

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

@hantu85
Copy link
Contributor

hantu85 commented Feb 16, 2023

I do not think this is related to #184 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?

@hantu85 hantu85 self-assigned this Feb 16, 2023
@PolarianDev
Copy link
Author

@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.

@licaon-kter
Copy link

@PolarianDev is MAM enabled in Siskin too?

@PolarianDev
Copy link
Author

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.

@licaon-kter
Copy link

@PolarianDev

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

@PolarianDev
Copy link
Author

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

@PolarianDev
Copy link
Author

@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!

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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.

@PolarianDev
Copy link
Author

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?

@PolarianDev
Copy link
Author

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?

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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.

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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?

@PolarianDev
Copy link
Author

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...

@PolarianDev
Copy link
Author

Does siskin IM have logging enabled?

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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).

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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?

@PolarianDev
Copy link
Author

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...

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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.

@PolarianDev
Copy link
Author

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?

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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?

@PolarianDev
Copy link
Author

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?

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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).

@hantu85
Copy link
Contributor

hantu85 commented Feb 21, 2023

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.

@PolarianDev
Copy link
Author

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?

@PolarianDev
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants