New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Particle.connected() should return true only after handshake messages are acknowledged #1825
Conversation
@m-mcgowan I'd like to merge this PR, could you please take a look at it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a significant change, I'm approving it since the code looks good from inspection and it's blocking other work, but I'd like to draw up a more comprehensive test plan prior to release.
@@ -56,8 +56,11 @@ static uint32_t start_ymodem_flasher_serial_speed = START_YMODEM_FLASHER_SERIAL_ | |||
|
|||
ymodem_serial_flash_update_handler Ymodem_Serial_Flash_Update_Handler = NULL; | |||
|
|||
// TODO: Use a single state variable instead of SPARK_CLOUD_XXX flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
What specifically do you think needs to be tested in addition to what is already covered by the unit tests and test app in this PR? |
…ver have been processed
…; minor renamings
dabc06c
to
a717056
Compare
I'd like to test the edge cases with end to end tests to be sure the integration works as expected. E.g. what happens when none of the system messages are delivered? or just some of them? I know we expect a timeout, so we should have tests to validate that. Are we certain that a race condition doesn't occur where the response is received so quickly that we empty the message queue and consider the handshake complete when it's not? |
Problem
Particle.connected()
returnstrue
immediately after the session is resumed, even if the session data became invalid for some reason and the device will in fact never receive ACKs for its handshake messages until the next connection attempt.Solution
Particle.publish()
and other cloud functions in the Wiring API fail early if the device is not connected to the cloud.Steps to Test
Particle.connected()
changes its return value only after all expected ACKs are received from the server.Example App
References