Alive session temporarily kicked off or receiving offline messages while being online

Not sure if this is an Openfire issue, but i can’t think how this can be a Spark issue (still probable). Recently i started seeing a strange issue. I lock my PC and go away for a few minutes (my PC is set to not go to sleep even). During that time someone sends me a message. Then i unlock my PC (Win 7 x86) and i see how a new tab appears in my Spark chat window and if i go there is says “xx:xx User (Offline) message”. It’s like i was offline when it was sent and now i went online and it was sent to me by the server. But i wasn’t offline. I can understand that, if my PC would be in sleep during that time, network down and Spark offline, but that just can’t happen. Looks like Openfire is sometimes treating my Away status as being too much idle and closing my session, but when i unlock my PC and Spark sets the status back to Online it then restores my session…

Weird. Could be something strange going on with the latest Spark build, but i can’t imagine what. Spark thinking it’s offline when the PC is locked (Away status automatically kicks in). Maybe that’s a side effect of the recent changes to idle code. @speedy seeing anything similar? Although it happens like a few times in a week. Not easily reproducible.

yeah, i’ve seen this a time or two, but figured it was network related. I don’t think the idle code should do anything, although it could have since there was a change to this bit of code.

IdlePresencePriority = -2

yep…that’s it. this can be replicated by changing presence priority with an “online” presence state.

Talking about this PR? SPARK-1455 by speedy01 · Pull Request #103 · igniterealtime/Spark · GitHub

Can we use other priority value for Idle then? Have filed this as [SPARK-1726] Spark is setting negative priority when switching to Idle - IgniteRealtime JIRA

Although xmpp lets you set a negative priority, so a server then stores messages as offline, but i think it is not correct to switch to it when just going into Away after an idle time.

yeah, this was my lack of understanding how how the presence priority worked. I’ve found 3 different parts of spark that handle presence individually (phoneplugin, the sip phone plugin, and the idle code). so to try to keep things straight, I tried to use the presence priority as a marker. I think ideally, there should be a single point for controlling presence to avoid various conflicts??. I’m sure there are much better way, i just don’t how! .

I’ll try to have this fixed tonight

No problem. This is not a major issue, as users still get messages (though there can be an undesired delay in some cases).

So, OnThePhone presence is using -1 for its priority? Strange. Because this means the user is essentially offline for the server while he’s on the phone.

I noticed that too, which is prob why I think -2 wouldn’t hurt! knowing what I know now, I think it will be best to change that too.

ok, I submitted a pr. Not sure why I didn’t do it this way the first time i tried!

Looks like working fine now. And i have even discovered another issue with the negative priority. Email on Away doesn’t work with it as negative priority is considered as offline so Email on Away wasn’t firing up in the case of an idle presence. Now it works.

yeah, im lost on the priority. from “The value MUST be an integer between -128 and +127” I guess that’s a 128 ways be considered offline! lol