Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

JS Client - Always check for valid reconnect window before making a request in clients #2484

Closed
DamianEdwards opened this Issue · 4 comments

4 participants

@DamianEdwards

Before the client makes any request (after connecting) it should always check to ensure that the time since the server was last heard from (the last successful result from the server) is less than the configured disconnect threshold.

This is in addition to the keep alive check that runs in forever transports. It helps address scenarios where the client makes requests although the server has already disconnect them, e.g. when a browser is suspended on a mobile device.

@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a reconnect window through which reconnects ensure that a time …
…threshold has not been passed.

- Tracked time stamps on connections every time they receive a message.
- When attempting to reconnect check the last message time stamp.

#2484
b14d309
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484
91c5b81
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a reconnect window through which reconnects ensure that a time …
…threshold has not been passed.

- Tracked time stamps on connections every time they receive a message.
- When attempting to reconnect check the last message time stamp.

#2484
64772c4
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484
41c0f3f
@NTaylorMullen NTaylorMullen was assigned
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified keep alive to utilize the lastMessageAt property.
- Removed the lastKeepAlive member from the keep alive data since it was essentially the same as the lastMessageAt property.

#2484
a015975
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified tests to work with the new functionality of keep alive.
- I also removed several tests that no longer apply as valid tests due to the keep alive functionality changes.

#2484
d2257b3
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a reconnect window through which reconnects ensure that a time …
…threshold has not been passed.

- Tracked time stamps on connections every time they receive a message.
- When attempting to reconnect check the last message time stamp.

#2484
fd5624a
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484
e678e27
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified keep alive to utilize the lastMessageAt property.
- Removed the lastKeepAlive member from the keep alive data since it was essentially the same as the lastMessageAt property.

#2484
8793147
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified tests to work with the new functionality of keep alive.
- I also removed several tests that no longer apply as valid tests due to the keep alive functionality changes.

#2484
1409672
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Reduced the ConnectionTimeout to be equivalent to the DisconnectTimeout.
- This allows us to know when a client has been gone from a server for too long.  Prime example is mobile devices when they go into sleep mode.

#2484
b4d8969
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a reconnect window through which reconnects ensure that a time …
…threshold has not been passed.

- Tracked time stamps on connections every time they receive a message.
- When attempting to reconnect check the last message time stamp.

#2484
bb00715
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484
3a2afb8
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified keep alive to utilize the lastMessageAt property.
- Removed the lastKeepAlive member from the keep alive data since it was essentially the same as the lastMessageAt property.

#2484
0c85247
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified tests to work with the new functionality of keep alive.
- I also removed several tests that no longer apply as valid tests due to the keep alive functionality changes.

#2484
0860ec5
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Reduced the ConnectionTimeout to be equivalent to the DisconnectTimeout.
- This allows us to know when a client has been gone from a server for too long.  Prime example is mobile devices when they go into sleep mode.

#2484
ed3c5bb
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a reconnect window through which reconnects ensure that a time …
…threshold has not been passed.

- Tracked time stamps on connections every time they receive a message.
- When attempting to reconnect check the last message time stamp.

#2484
cd93484
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484
7d29167
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified keep alive to utilize the lastMessageAt property.
- Removed the lastKeepAlive member from the keep alive data since it was essentially the same as the lastMessageAt property.

#2484
5c29471
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Modified tests to work with the new functionality of keep alive.
- I also removed several tests that no longer apply as valid tests due to the keep alive functionality changes.

#2484
c21264a
@Xiaohongt Xiaohongt was assigned
@NTaylorMullen
Collaborator

Marking this as working again, going to change how we monitor active states on the client.

@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a generic heartbeat method that is used to check keep alive but…
… also do any other time related tasks.

- This also involved modifying a lot of the tests to start heartbeats instead of keep alive check loops.

#2484
60bc161
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a lastActiveAt property that is used to indicate if JavaScript …
…is running in the browser.

- Utilized the new generic heart beat check
- Reverted the ConnectionTimeout change and left it at 110 seconds.

#2484
5c3f4af
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a generic heartbeat method that is used to check keep alive but…
… also do any other time related tasks.

- This also involved modifying a lot of the tests to start heartbeats instead of keep alive check loops.

#2484
877d643
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added a lastActiveAt property that is used to indicate if JavaScript …
…is running in the browser.

- Utilized the new generic heart beat check
- Reverted the ConnectionTimeout change and left it at 110 seconds.

#2484
887a8ca
@gustavo-armenta

verified

@NTaylorMullen
Collaborator

Reopening because of an issue found in the 1.1.5 port of the C# version: #2629 (comment)

@NTaylorMullen NTaylorMullen reopened this
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added extra verifyReconnect checks to ensure that if the client goes …
…to sleep that we do not mark it active prior to trying to reconnect.

- Also added a test to verify that this scenario is covered.
- Changed how the test utilities verify that foreverFrame is enabled.

#2484
04fb35b
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added extra verifyReconnect checks to ensure that if the client goes …
…to sleep that we do not mark it active prior to trying to reconnect.

- Also added a test to verify that this scenario is covered.
- Changed how the test utilities verify that foreverFrame is enabled.

#2484
a950c66
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added extra verifyReconnect checks to ensure that if the client goes …
…to sleep that we do not mark it active prior to trying to reconnect.

- Also added a test to verify that this scenario is covered.
- Changed how the test utilities verify that foreverFrame is enabled.

#2484
e091a21
@NTaylorMullen NTaylorMullen was assigned
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added verifyReconnect steps to the markActive function of the common …
…transport logic.

- Added a test to verify the behavior.

#2484
cec32a7
@NTaylorMullen NTaylorMullen referenced this issue from a commit
@NTaylorMullen NTaylorMullen Added verifyReconnect steps to the markActive function of the common …
…transport logic.

- Added a test to verify the behavior.

#2484
659e34f
@gustavo-armenta

suspended winstore javascript app for longer than a minute, when the ap is re-activated the connection is disconnected as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.