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

Fix: sync iOS rid and Android id in the waypoint payload #1681

Open
pauloantoniassi opened this issue Apr 19, 2024 · 2 comments
Open

Fix: sync iOS rid and Android id in the waypoint payload #1681

pauloantoniassi opened this issue Apr 19, 2024 · 2 comments
Milestone

Comments

@pauloantoniassi
Copy link

Currently, even having an int/long ID, the Android app uses tst as a unique key. Meanwhile, iOS added the property rid. This difference causes issues when sending updates (via setWaypoints cmd) between both OS, Android can detect just fine duplicates (as they have the same tst), but the iOS is having a hard time detecting the duplicated object and may add an extra record to the list of regions/waypoints.

When a message without rid arrives to the iOS app, the app creates a rid from the hash of tst+name, but this means the name can not be changed at all. Also, new waypoints are created by the iOS app using random IDs, but this information is lost on the Android app, so updates submitted by the Android for a waypoint created by iOS might not have the same rid (because as the rid is missing, iOS will generate one from the hash, which might not match the random one).

My suggested implementation is to keep the tst as the "main" unique key in the Android app, but adds the rid property as a secondary unique key (maybe a hash from the tst). This way the app can save the rid generated by the iOS app (and send it back for updates) but also Waypoints as a whole will have an ID that is common and stable between OS's.


  • Tested with: Android 2.5.0-beta1 GMS (GH releases page) / iOS 17.2.5 (App Store)
@pauloantoniassi
Copy link
Author

Btw, I'm not an Android developer (I'm a BE dev), but I can try to implement this if it makes sense.

@wir3z
Copy link
Contributor

wir3z commented Apr 30, 2024

Fully agree with this concept. iOS using the name as key always breaks when the users decide they want to rename a waypoint.

As a workaround from the hub side, I send a clearWaypoints command before setWaypoints command. This removes all the waypoints on the mobile, and replaces then with "correct" ones.

Only catch is you need to send all waypoints vs update a single one.

@growse growse added this to the v2.6 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants