Protocol version field in the message contract #53
Labels
No labels
area:companion
area:docs
area:shared
area:tooling
area:watchapp
blocker
kind:chore
kind:feature
kind:spike
kind:test
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Depends on
#70 Watchapp distribution: UUID, appinfo, versioning and install path
robert/PedalPebble
#7 shared/message_keys.json plus C and Kotlin codegen
robert/PedalPebble
Reference
robert/PedalPebble#53
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
The watchapp and the companion are installed and updated independently - you will sideload a new watchapp and forget the APK, or the reverse. Without a version field the failure mode is subtly wrong numbers rather than an honest error.
Acceptance criteria
shared/message_keys.jsonand generated into both sidesFiles
shared/message_keys.jsonwatchapp/src/c/proto.ccompanion/.../pebble/Proto.ktNotes
Cheap now, painful to retrofit - this is why it lands in Phase 0 alongside #7 rather than later.
Update — 2026-09-02: say what a mismatch actually does
"Surfaced, not tolerated" did not say whether the app refuses to run or degrades (D46).
version each side speaks
showing none
PROTOCOL §4 do
Closed by PR #96 (merged): watch sends PROTO_VERSION on the reconnect edge and cold-start-already-connected case (ride_link.c) since it owns the only connection-state detection point right now (#4/#4's companion-side PebbleTransport is still a placeholder). state.c gains a pure, host-tested mismatch gate consulted at exactly the idle->running edge of ride_state_start_pause() \u2014 running/paused rides and pause/resume are unaffected even mid-mismatch, matching D46's scoped intent. carousel.c surfaces a real notice ("Watch vN / Phone vN / X is old") plus a distinct 3-pulse vibration so a refused Select doesn't read as a dead button. Companion-side ProtocolHandshake.kt is pure comparison logic (zero PebbleKit dependency), returning an exhaustive Match/Mismatch type with no degraded-mode case possible by construction. Version-bump rules were already documented (#7/D46); this PR only added a short pointer to where the runtime code landed.\n\nVerified for real on both toolchains: pebble build clean on gabbro/emery/basalt; 102/102 watchapp host tests (6 new); real
./gradlewAndroid/JVM builds and tests all green, XML reports confirm the new ProtocolHandshakeTest cases actually executed.