Skip to content

ConnectionManager.setSuspendTime() isn't called when a transport disconnects #220

@paddybyers

Description

@paddybyers

The ConnectionManager decides, when a transport drops (or fails to connect), whether to fall back to the disconnected state or to suspended. The idea is that suspended happens if it has been more than 2 minutes (Defaults.SUSPEND_TIME) since the last time it was connected.

The way this was implemented was to keep a record of the time at which suspended will be triggered, via setSuspendTime() : https://github.com/ably/ably-java/blob/master/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java#L552

The problem is that this is only called when a connection is first established, not when it transitions from connected to disconnected: https://github.com/ably/ably-java/blob/master/lib/src/main/java/io/ably/lib/transport/ConnectionManager.java#L398.

The result is that if a connection has been up for at least 2 minutes, it then goes straight to suspended when the connection drops :(

Metadata

Metadata

Assignees

Labels

bugSomething isn't working. It's clear that this does need to be fixed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions