mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-15 06:06:07 -06:00
[PR #421] feat: peer version exchange via Hello proto event #413
Labels
No labels
Xorg
documentation
enhancement
macos
pull-request
question
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/lan-mouse#413
Loading…
Add table
Add a link
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?
📋 Pull Request Information
Original PR: https://github.com/feschber/lan-mouse/pull/421
Author: @jondkinney
Created: 5/6/2026
Status: 🔄 Open
Base:
main← Head:split/02-peer-version📝 Commits (4)
d8414c9fix(proto): tolerate undecodable peer datagrams instead of disconnectingcd044befeat: peer version exchange with soft-warn UI indicator64212e0ui(client_row): sentence-case "Peer version" and "Ours" labels0598b89fix(version-exchange): also store peer commit on the listen side📊 Changes
14 files changed (+208 additions, -13 deletions)
View changed files
📝
lan-mouse-gtk/src/client_object.rs(+10 -0)📝
lan-mouse-gtk/src/client_object/imp.rs(+1 -0)📝
lan-mouse-gtk/src/client_row.rs(+36 -0)📝
lan-mouse-gtk/src/lib.rs(+24 -2)📝
lan-mouse-gtk/src/window.rs(+7 -0)📝
lan-mouse-ipc/src/lib.rs(+6 -0)📝
lan-mouse-proto/src/lib.rs(+27 -0)📝
src/client.rs(+6 -0)📝
src/config.rs(+12 -0)📝
src/connect.rs(+30 -8)📝
src/emulation.rs(+27 -0)📝
src/listen.rs(+10 -2)📝
src/main.rs(+1 -1)📝
src/service.rs(+11 -0)📄 Description
Summary
Peer version exchange — each peer surfaces the other's build commit hash in the GUI, with a soft-warn color indicator on mismatch.
ProtoEvent::Hello { commit: [u8; 8] }carries each peer'sshadow_rsSHORT_COMMITonce per session. Sender fires immediately after DTLS auth; listener mirrors the event back so the connect side'sreceive_looppopulatesClientState::peer_commitfor the right handle. Disconnect path clears it.Each outgoing-connection row's collapsed subtitle renders match status with Pango-colored markup: green when commits match, orange when mismatched or when the peer hasn't sent
Hello(older build). Soft-warn only — version mismatch never refuses traffic. The local commit reaches the GTK frontend (separate process) via an explicitlocal_commitparameter onlan_mouse_gtk::run, stashed in aOnceLockso per-row UI can compare against each peer's hash without an IPC round-trip.EventType::Hellois appended to the enum so existing IDs are untouched. Old peers hit the existingInvalidEventIdskip path from3025422and silently ignore the event — backward interop preserved.Listen-side mirror (
1ea7148): the original implementation readpeer_commitonly off the outgoing-connect path, on the assumption that bidirectional setups always have a working outbound connection in both directions. That assumption broke the moment any direction's outbound was down (e.g. peer's TCP listener temporarily not bound) — version display silently said "unknown" while the peer was happily sending events to us inbound. NewEmulationEvent::PeerHello { addr, commit }variant fired from the listen-side Hello handler; service mapsaddr → ClientHandleviaclient_manager.get_client(addr)and stampspeer_commitexactly like the connect path. Version visibility is now independent of outbound reachability.Test plan
peer_commitso the next connect starts freshSplit out from #418, the umbrella PR collecting ~10 independent feature areas. This PR is the peer-version-exchange subset and stacks on top of the cursor-sync/wall-press PR. See #418 for the full picture.
Stack overview
These PRs are split out from #418 and stack in this order:
Each PR's branch builds on the previous one, so until earlier PRs are merged the cumulative diff against
mainincludes all preceding work. Reviewing in order is easiest.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.