Skip to content

feat(dockhand): driver to dock office handoffs offline, synced to mygeotab - #22

Merged
mizanxali merged 6 commits into
mainfrom
app/dockhand
Oct 14, 2026
Merged

mizanxali merged 6 commits into
mainfrom
app/dockhand

Conversation

@mizanxali

@mizanxali mizanxali commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

What

A new example app, DockHand, for fleet yards. A driver checks in at the dock office over Bluetooth and the office assigns a dock, with no signal on either phone. Both phones sign the handoff, so it works as a receipt. When either phone gets back online, the handoff is written to MyGeotab as AddInData, together with the GPS fix the vehicle's GO device logged nearest to check-in. The GO hardware is not changed.

  • Offline handoff. A driver's check-in is resent until the dock office acknowledges it. Every record has a stable handoffId, so resends never create duplicates.
  • Signed receipts.
    • The driver signs the load details with the phone's mesh identity key (Ed25519).
    • The dock office stores a check-in only if the signature verifies and the key matches the sending phone's address.
    • The dock office countersigns the check-in plus the dock, and the driver checks that countersignature against its own copy.
  • MyGeotab sync.
    • Optional sign-in. Only the session is kept on the phone, never the password.
    • Each record is looked up by handoffId before it is added, so a retry, or both phones syncing, does not add it twice.
    • Without a database, Mock sync runs the same duplicate check on the phone.
  • MyGeotab Add-In page (apps/dockhand/mygeotab-addin/). It lists the handoffs and checks both signatures in the browser with WebCrypto. The fields it shows are read from the signed texts.

Shared change

@offline-app-examples/mesh gets sign(text) and verify(address, text, signed) on NearbyRoom and useNearbyRoom. verify checks that the key derives to the sender's address before it checks the signature. The package has tests and a README section for both.

Checks

  • Typecheck and lint pass. Lint reports 0 errors and 5 no-void warnings; the other apps have the same warnings.
  • Tests pass: DockHand 16/16, mesh 4/4.
  • The CI matrix now includes dockhand, with the iOS scheme DockHand.

Device run with an iPhone 16 as the driver and a Samsung M17 as the dock office, over Bluetooth with Wi-Fi off:

  • Join took about 5 s.
  • Each check-in and each signed assignment arrived in 3 to 6 s.
  • Signatures verified in both directions.
  • Round trips still worked after backgrounding the app and after toggling Wi-Fi.
  • Mock sync dropped duplicates on both phones.

Not covered

  • Live MyGeotab. The MyGeotab client and the Add-In page are tested against recorded API shapes only. No live database has been used, and the page's rendering has not been run in a browser.
  • Demo gif. There isn't one yet; the other apps have one.
  • Add-in id. ADD_IN_ID is a placeholder. A real integration should generate its own.

Geotab, MyGeotab and GO are trademarks of Geotab Inc. The README says this example is not affiliated with or endorsed by Geotab.

Comment thread apps/dockhand/__tests__/handoff.test.ts Fixed
@mizanxali
mizanxali merged commit f9749d3 into main Oct 14, 2026
26 of 27 checks passed
@mizanxali
mizanxali deleted the app/dockhand branch October 14, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants