October 13, 2026
5 pull requests merged across 1 repo
Offline-Protocol/offline-protocol-sdk
0.29.0 is published on every channel, so the READMEs move to it, as #521 did for 0.28.0.
- README.md: the Swift install snippet reads
from: "0.29.0". - bindings/python/README.md: the Linux wheel build example passes
0.29.0. The dated record of the 2026-10-12 build keeps its 0.28.0 wheel name, because it records what was run. - bindings/python/docker/README.md and examples/http-front/README.md: drop "no release has the HTTP front". The image installs from PyPI, and the published 0.29.0 wheel has
offline-protocol-http-front,offline-protocol-verifyand thehttpextra (checked against the PyPI manylinux x86_64 wheel's entry points and metadata).
Verification
- 67 relative links and anchors in the four files resolve.
- No source guard pins the edited sentences.
Type of change
-
docs
Cuts 0.29.0: v0.28.0 plus 20 PRs (#521 to #551).
- Versions:
[workspace.package]and the eleven internal dependency versions inCargo.toml, the four local ones inoffline-protocol-sealedandoffline-protocol-leaf,pyproject.toml,package.jsonand its lock, the three lockfiles (root,tools/embedded-footprint,tools/mls-interop), and the threeTHIRD-PARTY-NOTICES.md(regenerated). The lockfile diffs touch only our own crates. - CHANGELOG:
[Unreleased]becomes[0.29.0] — 2026-10-13, and the §27 anchor follows the new heading. 0.28.0 moves todocs/changelog/0.28.md, with a row in both archive tables. - Missing entry: adds a Fixed entry for #547 (Android closes a dropped link's GATT client).
- SECURITY.md: the supported line is now
0.29.x. - UPGRADING: the current line is
v0.29.x, the intro namesv0.29.0as the release with the one narrow build break, and §27 is labelled *(v0.29.0)*.
Verification
cargo test --workspace: 3319 passed, 0 failed.- The archive move is lossless. Re-extracting the 0.28.0 section from
HEAD:CHANGELOG.mdand diffing it againstdocs/changelog/0.28.mdchanges only link lines, each rewritten to../or../../. - Every
](path#anchor)in every tracked markdown file resolves the same before and after the change. The 3 hits that remain are example text in CONTRIBUTING and a regex indocs/spec/http-front.md, not links.
Before tagging
- If this merges on a different day, update the date in the
## [0.29.0]heading so it matches the tag. - Run a release dry run from this branch (
workflow_dispatch,dry_run: true,version: 0.29.0). The release workflow has not run sincev0.28.0, and this cycle added the container image andoffline-protocol-verify. - Decide whether to name #514 (rare Android event gap) as a known issue.
- After the release is green, run
gh workflow run publish.yml -R Offline-Protocol/offline-protocol-swift -f version=0.29.0.
Type of change
-
chore
Breaking changes
None in this PR. The release itself carries the one narrow Rust build break that UPGRADING §27 documents (encrypted on the two service events).
Problem
The demo app kept groups in screen memory only, and no event carries a group's name and full member list. A group message carries neither, and an invited device hears only the add that named it.
- After an app restart, a group the SDK still held read as "Group", 1 member, because the first event the app saw for it was a message.
- An invited device counted 3 members of a 4-member group (seen in the #549 hardware run).
The SDK already exposes the real record (meshListGroups, meshGetGroupInfo). The app never called either.
Fix
examples/demo-app/src/context/ProtocolContext.tsx reads the SDK's record and treats it as the source of truth:
- At start, after
start(): learn the local address, then read every groupmeshListGroupsreturns. - On a group message for a group not read yet in this process.
- On
group_created,group_member_added,group_member_removed(another member) anduser_groups.
Two guards keep the reads honest:
- A membership change that arrives while a read is in flight marks it to run again, so the last change always lands.
- A read still in flight when this device leaves, or is removed, cannot put the group back. Being added again clears the mark.
The SDK names members by address, and the app names itself by profile id, so this device's address is mapped to the profile id. That keeps "You" and the self checks working.
A CHANGELOG entry sits beside the #549 demo app entry under Unreleased, Fixed.
Verification
Hardware run on 2026-10-13, main at e2512d0a plus this change. Devices: a Galaxy M36 running the demo app, two Raspberry Pi 4s and a Mac running the Python service. The four are in one group.
| Check | Before | After |
|---|---|---|
| Group list after an app restart | "Group", 1 member | "Issue 549 mesh check", 4 members |
| Member chips | You | pi-b, pi-a, Mac, You |
| Group messages, every device to every other | 12 of 12 delivered | 12 of 12 delivered |
npx tsc --noEmitpasses inexamples/demo-app.- No CI job covers
examples/demo-app, so the typecheck and the hardware run are the only checks. ProtocolContext.tsxalready failedprettier --checkon main, so it was not reformatted here.
Not in this PR
- Contacts and group message history are still kept in memory only, so both are lost when the app restarts.
Covers the three problems from the hardware run of the Android demo app against two Raspberry Pis.
1. A restart gave the device a new identity
generateUserId() cached the user_<time>_<random> profile in a module variable only, and the SDK keeps the identity per profile, so every process start meant a new address. The profile and the display name now live in AsyncStorage (@react-native-async-storage/async-storage 2.2, autolinked; Podfile.lock updated). Only a reinstall mints a new identity. If the profile read fails, start fails instead of quietly minting a fresh identity. Saving the name is best effort.
2. People showed 0 peers while messages flowed
The app's sweep dropped any neighbour whose last neighbor_discovered was more than 60 s old. The engine reports neighbor_discovered and neighbor_lost as the link's up and down edges: one loss per departure, including the radio going off, and nothing while the link holds. So the sweep was removing peers whose links were still up. Neighbours now follow those edges only, and a contact counts as nearby while it is a neighbour. A contact that is not a neighbour still loses "nearby" after 30 s, as before.
3. The phone's own outgoing connections never completed
Three defects in BleTransportFacade, and they made each other worse:
- No connect timeout.
CONNECTION_TIMEOUT_MSwas declared but never used. A dial with no callback kept itsgattClientsentry, and the scan answered every later advertisement with "already connected/connecting". A dial that has not connected after 20 s is now closed (armConnectWatchdog), and the scan dials again. The watchdog only touches its own dial, and only if that dial never connected. - One link counted twice. Android reports a client link of ours to the GATT server as a central connecting.
connectionCount()added the two maps together, so one link counted twice and two dials filled the cap of four. That fits "cap reached" half a second after a fresh start. The count is now per peer address. - The cap check cancelled our own link. The inbound path ran the cap check (and the mesh rejection) on the server-side report of our own dial and called
cancelConnection, which tore down the link the dial was waiting on. This fits "Connecting to B1:82" followed 250 ms later by "Rejecting inbound connection from B1:82: connection cap reached". A central at an address we dialed is now neither refused nor counted. Inbound peers are turned away only for completed links. A dial to a peer already connected to our GATT server is not refused by the cap.
The cap is now soft by one in-flight dial: an inbound peer accepted while a dial is pending can bring the total to five if the dial completes. The alternative is turning away a working peer because of a dial that may never complete.
Still open from the issue: whether a stale link left over from the previous process counts at start. Nothing in this PR can tell such a link from a live one.
Tests
- New
ConnectionCapCountTest(Robolectric, 5 cases): a dial plus its server-side report count as one link, a pending dial is not an established link, and closing a dial frees its slot. - New Rust source guard
react_native_android_a_dial_that_never_connects_is_closed_and_redialed. It checks that the watchdog is armed afterregisterGatt, that it skips a later dial or a completed one, that it frees the address, and the three inbound conditions. Negative control: removing thearmConnectWatchdogcall fails it. The existing duplicate-link guard now pins the new cap call. cargo test -p offline-protocol-uniffi --lib: 213 passed.cargo clippy -p offline-protocol-uniffi -- -D warningsandcargo fmt --checkare clean.- Android module unit tests (scratch copy via
android-ci-harness): 686 run. The only failures are the 10PeerStreamFramingTestcases, which cannot find the repo-relative vector file in a copy outside the repo. They are unrelated and pass in CI. - Demo app
tsc --noEmitis clean.
Not run on hardware. This needs another run with the Galaxy M36 and the Pis: force-stop and relaunch (same off1… address, same name), People with Pi links open for more than 2 minutes, and logcat showing outgoing dials either completing or BLE connect timed out followed by a redial. The other examples (nostr-example, react-native-app) have the same per-launch profile pattern. That is out of scope here.
Two engine fixes found by running the offline-first harness and the HTTP front demo on real hardware: two Raspberry Pi 4s (Raspberry Pi OS trixie) each connected to a Mac over USB-C as a network gadget, plus the Android demo app over Bluetooth LE. The Pis share no IP network, so the Mac is the only LAN path between them (pi-a -- Mac -- pi-b), which is the runner's topology for scenarios 4 and 5.
1. A mesh forwarder suppressed the sender's own retransmission (fix(protocol))
Scenario 5: C was off, A sent, B took the message, A went off, C came back and received it from B. C's acknowledgement went nowhere because A was off. After A restarted, its retry_queue_size stayed at 1 with pending_ack_count 0 for over ten minutes.
Cause: A's retry reached B, and B had already forwarded that id. Both relay intakes (absorb_settled_duplicate and admit) refused it as a duplicate for the whole 600 s retention window (B's duplicates_suppressed went up by one each time A transmitted). C never saw the re-send, so it never re-acknowledged, and A retried into B until the window lapsed. docs/mesh.md stated this as intended ("including the sender's own retransmissions of it"). But delivery-and-acks.md relies on the duplicate re-acknowledgement to settle a sender whose acknowledgement was lost, and custody.md already forbids the same black hole for a custodian.
Fix: a copy that arrives over the link that proved its sender, with no hop spent, and with no copy of ours still pending, is taken on again. It goes through the full admission (the neighbour's rate, hop budget, queue) and is recorded again. Echoes from any other forwarder carry a spent hop and stay suppressed. A neighbour that only claims to be the origin gains one more forward of a frame it already holds, charged to its own rate. It could already mint fresh ids at that rate.
2. A peer stream proved before its layer was up formed no session without traffic (fix(uniffi))
First pair between a fresh pi-a and the Mac took 14 to 17 s every round, and once timed out at 90 s (NoKeyPackage).
Cause: the Python peer-stream manager opens its listener, then starts DNS-SD (about 3.6 s on a Pi), and only then calls wifi_direct_status_changed(true). A peer that connects in that window is announced while the layer is down. Discovery's key package push fails, and is deliberately not recorded as sent so the next discovery retries it. But the layer coming up revealed the link silently, so there was no next discovery. When the other side's push was also lost to stream supersession (both ends dial), the pair formed no session until an application sent something. The iOS and Android managers also report the layer after their listener starts, with a much narrower window.
Fix (engine side, so it covers all three platforms): wifi_direct_status_changed announces every link the flip reveals to discovery.
Not changed
Messages from the Android demo app to a Pi were decrypted and acknowledged (the app shows ✓✓), but did not appear in offline-protocol-verify watch on the Pi. That is the local API's per-app_id routing working as designed (local_api/mux.py): the verifier connects under its own app id, and the demo app's messages are held for the demo app's id.
Tests
- New
test_wifi_direct_link_proved_while_down_gets_the_key_package_when_the_layer_comes_up(fails before the fix: no key package is ever queued once the layer comes up). - New
the_origin_re_sending_a_forwarded_frame_is_forwarded_again; the custody-intake test's setup now uses a non-origin copy for its "a copy would be refused" premise. cargo clippy --workspace -- -D warnings,cargo test --workspace --lib(3203 passed),RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps, Python suite (1087 passed).
On hardware (both fixes on all three devices)
| Check | Before | After |
|---|---|---|
| link + sessions (fresh identity) | FAIL, 90 s NoKeyPackage; 14 to 17 s when it passed | pass 2.8 s; 1 to 6 s over 3 rounds |
| HTTP front a -> c through the Mac | pass 8.2 s | pass 5.2 s |
| 1 store and forward | pass | pass |
| 2 sender restarts | pass | pass |
| 4 through the middle | pass | pass |
| 5 carried, sender off | FAIL, retry entry stuck 10+ min | pass, 3 of 3 runs |
| Bluetooth LE only, Pi <-> Pi, HTTP over BLE | pass | pass |