nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
696 stars 1.7k forks source link

Wear OS: AAPS API version compatibility checks #1892

Closed Andries-Smit closed 1 year ago

Andries-Smit commented 2 years ago

Before 3.1 communication was less problematic for version mismatches between AAPS phone and watch app. Currently, if the API is mismatching the Watch or Phone app crashes when it tries to deserialize an object. This should be prevented.

Suggestion to introduce an API version, which is communicated beginning of the connection. When it mismatches the API should be halted and the user informed. The alternative is a strict match on the matching AAPS version.

Al least the deserialization error should be caught without crashing the app.

MilosKozak commented 2 years ago

https://github.com/nightscout/AndroidAPS/commit/e1423c0f82a2c56a7d7e1ac734c413ab80b24285

Andries-Smit commented 2 years ago

Thanks this will prevent the crashes! Should the Error have a description user message and logged the log files for debugging purposes?