XMPPTCPConnection.isSmResumptionPossible returns always true in a case of reconnection

Hi guys,

I use Smack 4.1.5 SNAPSHOT

and found an issue with XMPPTCPConnection.isSmResumptionPossible method,
it returns always true in a case of reconnection

I noticed that shutdownTimestamp is always null inside isSmResumptionPossible method after reconnection and as a result
you do Stream Resumption inside **loginNonAnonymously **method

In a case of reconnection and stream resumption enabled I guess you don’t need to reset it in the method PacketWriter.init

Hi Igor,

I’ve a problem following your report:

found an issue with XMPPTCPConnection.isSmResumptionPossible method,

it returns always true in a case of reconnection

In case the stream management was not enabled on reconnection?

I noticed that shutdownTimestamp is always null inside isSmResumptionPossible method after reconnection and as a result

you do Stream Resumption inside loginNonAnonymously method

always null? Shouldn’t it be set by PacketWriter.shutdown()?

What do you mean by reconnection? Calling disconnect() and connect()? Or instantShutdown() and connect()?

Hi Flow,

my settings are

connection.setUseStreamManagement(true);

connection.setUseStreamManagementResumption(true);

What do you mean by reconnection? Calling disconnect() and connect()? Or instantShutdown() and connect()?
I mean to switch off and then on the internet connection on Android phone

always null? Shouldn’t it be set by PacketWriter.shutdown()?
I would say it should not in a case of Stream Resumption enabled

To be more clear, here are all steps to reproduce the issue:

  1. Enable SM and SR

connection.setUseStreamManagement(true);

connection.setUseStreamManagementResumption(true);

  1. Connect and Login to Chat server

  2. Switch OFF the Internet connection on Android phone

  3. Wait 2 mins and switch ON the Internet connection on Android phone

  4. The method XMPPTCPConnection.isSmResumptionPossible returned True, so user is trying to resume previous stream, but it fails on the backend because 2 minutes it’s too late. Default max value of stream resumption is 60 seconds.

The question is why it returned true after 2 mins of disconnection?
The default value of stream resumption time is 60 seconds.

Flow,
did you have a chance to check the issue?
Or should I create a pull request here Pull Requests · igniterealtime/Smack · GitHub with a fix?

The question is why it returned true after 2 mins of disconnection?
Hard to tell with the information available. AnXMPP trace of the session may be helpful.

I still fail to follow the issue. But since it appears you have a fix in mind, it may helps if you show it to us, then we can talk about it and maybe figure it out.