Skip to content

fix: notification id, SMS ids and thread requests, pair reject; correct IPC docs - #52

Merged
bethropolis merged 4 commits into
bethropolis:mainfrom
Rishabh672003:fix/ipc-doc-mismatches
Oct 5, 2026
Merged

bethropolis merged 4 commits into
bethropolis:mainfrom
Rishabh672003:fix/ipc-doc-mismatches

Conversation

@Rishabh672003

Copy link
Copy Markdown
Contributor

Notification id missing. notification events had no id, so clients couldn't dismiss a notification or match it to notification.canceled. Events now include it.

SMS message id always 0. Android sends the message id as _id, but kcd read u_id, so every sms.incoming had u_id: 0. kcd now reads _id.

SMS thread request returns nothing. Omitted rangeStartTimestamp / numberToRequest were decoded as 0 and sent to the phone, which then returns zero messages. This also broke kcd sms conversation. Omitted fields are now left out, so the phone returns the whole thread.

Pair reject accepts. pair ignored reject: for a pending incoming request, {"reject": true} paired the device. Reject now declines (same as unpair).

Docs. share takes filePath, not file; the pair and SMS range descriptions are corrected.

Each fix has a test that fails on main. Checked live on 1.22.1: a thread request without a range returned nothing, and every message had u_id: 0.

AI assisted

notification events had no id although the docs show one, so clients
could not call notify_dismiss or match notification.canceled (which
does carry the id) to the notification it cancels.

AI assisted
…tted

- Android sends the message id as "_id" (Telephony.Sms._ID), so
  sms.incoming always carried u_id 0 and clients could not de-duplicate.
- sms_request_conversation decoded omitted rangeStartTimestamp and
  numberToRequest to 0 and forwarded them, asking the phone for zero
  messages older than the epoch; the documented minimal request
  {deviceId, threadID} returned nothing (also hit by kcd sms conversation).
  Omitted fields are now left out, which Android treats as the whole thread.

AI assisted
handlePair ignored the documented accept/reject flags. For a device in
PAIR_REQUESTED_BY_PEER, {"reject": true} took the accept path and
paired the device the user meant to decline. Treat reject as unpair.

AI assisted
share takes filePath, pair accepts unless reject is set, and omitted SMS
range fields return the whole thread.

AI assisted
@bethropolis
bethropolis merged commit b5ba3c9 into bethropolis:main Oct 5, 2026
9 checks passed
@Rishabh672003
Rishabh672003 deleted the fix/ipc-doc-mismatches branch October 5, 2026 07:30
bethropolis added a commit that referenced this pull request Oct 11, 2026
The #52 range fix (omitted fields stay out of the packet) was reachable
only over raw IPC: the CLI sent no range fields at all. This exposes
them as flags mapping 1:1 to rangeStartTimestamp/numberToRequest.

Unset stays unset. IsSet, not a zero default, decides whether a field
goes in the packet, because the phone reads an explicit 0 as "older
than the epoch" or "zero messages" and returns nothing. Negatives are
rejected: neither a ms epoch nor a count can be negative.

SmsRequestConversation keeps its signature and delegates with nils, so
the public client API does not break; the range form is additive.

Live note: verified the default path end to end (126 messages, whole
thread) and the payload shapes by test. The capped path could not be
confirmed live: the phone stopped answering SMS requests mid-session
(its SMS plugin has since been disabled device-side, which is also the
documented way to end the latch). Retest with the app awake and
unrestricted if the cap's phone-side handling is ever in doubt.
@bethropolis bethropolis mentioned this pull request Oct 11, 2026
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