-
Notifications
You must be signed in to change notification settings - Fork 266
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
rumqttc: resume session only if CONNACK with session present 1 #864
rumqttc: resume session only if CONNACK with session present 1 #864
Conversation
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.
changes requested against bytebeamio#864
can you please fix the code / tests? the |
To test, I think we need #854. With that, we need to connect with clean session false and session expiry interval non-zero to let broker save state. |
…ao/v5_session_state_store
…aocq2001/rumqtt into chxiao/v5_session_state_store
Facing an issue on connection.
It seems on host side session is not stored? Another question: due to MQTT protocol difference between versions, in v5 session_expiry_interval is supported but in v3 it is not, what is the suggestion on handling such difference in tests? |
xiaocq2001#2 solves this inconsistency in the tests
The tests focus mainly on v4 as of right now, we are yet to see contributions towards better testing the v5 code. But we are happy to... |
I realize that in failing tests, the broker is started by OK. I saw the updates to update broker, that's great. |
test: fix test to follow MQTT standards
Pull Request Test Coverage Report for Build 9166733626Details
💛 - Coveralls |
…eamio#864) * Check if session present to restore pending publishes. * Modify changelog. * remove changes that don't seem to be related * refactor: improve readability * feat: apply changes to v4 * Remove session_expiry_interval related code. * test: set clean session * test: broker saved session * test: fix resume reconnect --------- Co-authored-by: Devdutt Shenoi <[email protected]> Co-authored-by: Devdutt Shenoi <[email protected]>
commit 518773d Author: CQ Xiao <[email protected]> Date: Tue May 21 14:47:32 2024 +0800 rumqttc: resume session only if CONNACK with session present 1 (bytebeamio#864) * Check if session present to restore pending publishes. * Modify changelog. * remove changes that don't seem to be related * refactor: improve readability * feat: apply changes to v4 * Remove session_expiry_interval related code. * test: set clean session * test: broker saved session * test: fix resume reconnect --------- Co-authored-by: Devdutt Shenoi <[email protected]> Co-authored-by: Devdutt Shenoi <[email protected]> commit 67d9ca7 Author: CQ Xiao <[email protected]> Date: Thu May 16 23:05:10 2024 +0800 feat(rumqttc): set `session_expiry_interval` in v5 (bytebeamio#854) Co-authored-by: Devdutt Shenoi <[email protected]> commit 98997d1 Author: CQ Xiao <[email protected]> Date: Wed Jul 3 18:13:54 2024 +0800 HashMap -> VecDeque, cleanup
Type of change
Implement for #863.
Bug fix (non-breaking change which fixes an issue):
In MQTT, session is not always resumed, but in current mqttc the pending publishes are restored anyway.
With this fix the CONNACK session present returned from broker is checked, to confirm if a session is actually resumed, if not the pending publishes are cleaned and new session is started.
Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.