android
android copied to clipboard
Save the last response so we can properly unsubscribe from events when the response ID has changed
Summary
This PR attempts to fix #2774 by keeping track of the lastResponse
so we can unsubscribe with the correct response ID.
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
This will create problems when using multiple subscriptions of different types, for example when adding device controls or in the Wear OS app. The app will try to unsubscribe from all subscriptions with the ID of the last subscription.
Thanks I didn't see this initially but it seems my logcat filtering was not correct 🤦
Ok looks like the subscriptions and unsubscriptions are working as expected now
It works and fixes the bug the user mentioned in their comment on the issue 👍
Potential improvement: store only the id
in the response that is returned instead of the entire response, as only the ID is used.
Potential improvement: store only the
id
in the response that is returned instead of the entire response, as only the ID is used.
Done, now only storing the ID :)