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

Closed
DamianEdwards opened this Issue Sep 4, 2013 · 4 comments

Comments

Projects
None yet
4 participants
Owner

DamianEdwards commented Sep 4, 2013

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 added a commit that referenced this issue Sep 5, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 5, 2013

Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484

NTaylorMullen added a commit that referenced this issue Sep 5, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 5, 2013

Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484

@ghost ghost assigned NTaylorMullen Sep 5, 2013

NTaylorMullen added a commit that referenced this issue Sep 6, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 6, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 12, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 12, 2013

Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484

NTaylorMullen added a commit that referenced this issue Sep 12, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 12, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 12, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

Added a test to verify that reconnecting transitions into the disconn…
…ected state if the reconnecting threshold exceeds the reconnectWindow.

#2484

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 16, 2013

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

@ghost ghost assigned Xiaohongt and NTaylorMullen Sep 16, 2013

Contributor

NTaylorMullen commented Sep 19, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 19, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 19, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 30, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 30, 2013

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

NTaylorMullen added a commit that referenced this issue Sep 30, 2013

@ghost ghost assigned gustavo-armenta Sep 30, 2013

Contributor

gustavo-armenta commented Oct 14, 2013

verified

Contributor

NTaylorMullen commented Oct 24, 2013

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

@NTaylorMullen NTaylorMullen reopened this Oct 24, 2013

@ghost ghost assigned NTaylorMullen Oct 24, 2013

NTaylorMullen added a commit that referenced this issue Oct 25, 2013

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

NTaylorMullen added a commit that referenced this issue Oct 28, 2013

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

NTaylorMullen added a commit that referenced this issue Oct 31, 2013

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

NTaylorMullen added a commit that referenced this issue Nov 5, 2013

Added verifyReconnect steps to the markActive function of the common …
…transport logic.

- Added a test to verify the behavior.

#2484

NTaylorMullen added a commit that referenced this issue Nov 12, 2013

Added verifyReconnect steps to the markActive function of the common …
…transport logic.

- Added a test to verify the behavior.

#2484

@ghost ghost assigned gustavo-armenta Nov 12, 2013

Contributor

gustavo-armenta commented Nov 15, 2013

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