Skip to content
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

Renew Cognito credentials on MQTT reconnection #37

Merged
merged 1 commit into from Jul 5, 2021
Merged

Renew Cognito credentials on MQTT reconnection #37

merged 1 commit into from Jul 5, 2021

Conversation

mochipon
Copy link
Owner

@mochipon mochipon commented Jul 5, 2021

Due to the websocket connection quota in AWS IoT, the websocket connection will be closed after 24 hours. The problem is the temporary credential from Cogninto has been out dated at that moment so we cannot reconnect then.

This PR aims to get new credentials from Cognito when the MQTT session is disconnected. Note that the callback (onOffline) does not block the process. It is possible that reconnection has already started with an old credential. The SDK will continue to retry, so it will eventually reconnect successfully once the new credentials are obtained.

fixes #36

@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #37 (c21aea6) into main (92833dc) will decrease coverage by 1.44%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
- Coverage   95.88%   94.44%   -1.45%     
==========================================
  Files           8        8              
  Lines         389      396       +7     
==========================================
+ Hits          373      374       +1     
- Misses         16       22       +6     
Impacted Files Coverage Δ
pysesame3/chsesame2.py 80.20% <14.28%> (-5.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92833dc...c21aea6. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Subscription to a device shadow cannot be continued after 24 hours
1 participant