-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Last Activity returns 0 seconds for unavailable sessions #2265
Comments
Ok, as far as i can figure out, i end up about here; Line 226 in 4b012a9
Which means that the user has resources that are not offline. What exactly does it take for a resource (session?) to be offline? I noticed that setting priority < 0 results in get_presence returning |
And why do you set presence to Unavailable, but still keep the XMPP session alive? When i tell my client to logout, it sends presence to unavailable, and closes the immediately the XMPP session: <presence type='unavailable'>
<priority>8</priority>
<status>testing the disconnection reason22</status>
</presence> |
We're connecting from an app, and leave our websocket open when the app goes to the background, indicating that we're offline by setting Do you have a suggestion for a better strategy? Should we simply disconnect entirely when going to the background? |
Sending a "presence=unavailable" is a graceful presence broadcasted to the contacts [1], but ejabberd does not unbind the resource from the stream, so it doesn't close the session, nor closes the stream. That's why, in the code you referenced, if there's any resource, whatever its kind, the user is considered to be online. Is that the expected behavior according to the protocols, or is a bug in ejabberd? Sorry, I don't know. Also I don't know if there's a more recomended way for you to achieve what you want. Let's see if somebody else can help here. |
I guess i always just assumed that the semantics were the same as in mod_offline, in that The XEP was not entirely clear to me in its wording before;
but reading it again, i reckon it means that if the session (socket in this case) is alive the server must return Anyways, thanks for having a look at it. I guess i'll see if someone has anything to add in the next few days and, if not, apply the workaround of disconnecting the session entirely, even when the app is only left momentarily. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
18.01
Debian GNU/Linux 8 (jessie)
package
I recently upgraded from 16.09 to 18.01, and now XEP-0012 returns 0 seconds even for a session that has been set to
unavailable
, e.g.The moment i kick the user, XEP-0012 will start correctly returning the last time any activity was seen from the user.
The text was updated successfully, but these errors were encountered: