docs(#1316): plan of record for the share-links Feature (#1280)

The Feature ran without a plan of record or an Integration Testing
epic. This is the plan from the FEATURE-PLAN template: diagnosis, five
epics (A and B already merged in #1308, C, D, and E for Integration
Testing), the Citadel chain, the can't-tell branches, the grant terms
for C to E, and the owner's choices.

Merging it approves the plan.

Agent: StormyElk (session 088ce922)
pull/1317/head
diffwireauto 2 days ago
parent 092676cd42
commit c62c19dca8

@ -0,0 +1,178 @@
# Feature PLAN: open share links in Offband
| | |
|---|---|
| **Feature** | [#1280](https://github.com/OffbandMesh/meshcore-client/issues/1280) · Citadel `meshcore-open-ukx` |
| **Serves** | No parent Initiative; a standalone Feature. |
| **Status** | Draft. Approved when this PR merges. |
| **Owner** | Strycher (Ben) |
| **Last updated** | 2026-11-30 |
## At a glance
- **What:** tapping a channel or contact share link, `meshcore://...` or `https://offband.app/add/...`, opens Offband at the add confirmation. Nothing is added without the user confirming.
- **Why now:** until #1308, no platform routed a link to Offband. A link posted on a website, in Discord or in a text did nothing.
- **How:** five Epics. A: one link handler. B: register `meshcore://` with each OS. C: offband.app App Links and Universal Links. D: Share and Copy Link emit the offband.app link. E: Integration Testing.
- **Done when:** a link shared from Offband, tapped in a browser, a messaging app or an Offband chat, opens the confirmation on Android, iOS and web, and on Windows once the installer (#1284) lands. Ben has approved the integration results.
## 1. Diagnosis
Verified 2026-11-29 against `dev`, before #1308.
| # | Finding | Evidence | Effect |
|---|---|---|---|
| 1 | No platform declared the `meshcore` scheme | `AndroidManifest.xml` had only MAIN/LAUNCHER; `ios/Runner/Info.plist` had no `CFBundleURLTypes` | A tapped link went nowhere |
| 2 | A `meshcore://` link in a chat message was plain text | flutter_linkify's `UrlLinkifier` matches only http(s) and www | No in-app tap path |
| 3 | A hashtag channel link with no `secret=` was refused | `Channel.fromShareUri` required `secret` | `meshcore://channel/add?name=%23example` failed, though the key derives from the name |
| 4 | offband.app answers `/.well-known/*` with the web app's HTML page | Cloudflare Pages single-page fallback; no files in `web/.well-known/` | Android and iOS cannot verify the domain, so https links cannot open the app |
| 5 | The stock MeshCore app also claims `meshcore://` | `pm query-activities` on the S26 Ultra lists both apps | Android shows a chooser and iOS picks one; only verified https links go straight to Offband |
| 6 | offband.app deploys from `main`; dev.offband.app from `dev` | `.github/workflows/deploy-web.yml` | Verification files reach production only at a release |
| 7 | iOS has no entitlements file, and the signing profile comes from a secret | no `Runner.entitlements`; `ios-signed.yml` reads `APPLE_PROFILE_BASE64` | Associated Domains needs a new profile from the Apple portal |
| 8 | The Android signing certificate is our own key | `apksigner` on the release APK: SHA-256 `e7da8cd5bf22ac3eda7cb954b8b120a18b6c4382d1b6e6fdd204ddedddaf5488`; Play App Signing uses the same key via PEPK | `assetlinks.json` can name it directly |
## 2. Scope
**In:**
- `meshcore://` channel, contact and legacy advert links, from any source, through one router (A).
- OS registration on Android, iOS and macOS (B).
- `https://offband.app/add/channel#...` and `/add/contact#...` as Android App Links and iOS Universal Links, falling back to the web client (C).
- Share and Copy Link emit the https form; QR codes stay `meshcore://` so the stock app can scan them (D).
- Integration Testing across all of it (E).
**Out:**
- Windows and Linux OS registration. It depends on how the app is installed: #1284, installer epic #1294. On Windows, links tapped inside Offband already work.
- Any change to the stock app or to firmware.
## 3. Epics
Each Epic ends with an Epic verification task. Unit tests fail first against `dev`.
### Epic A: one link handler ([#1285](https://github.com/OffbandMesh/meshcore-client/issues/1285)), merged in #1308
| Task | Pts |
|---|---|
| **A1 · Link router** ([#1289](https://github.com/OffbandMesh/meshcore-client/issues/1289)): `LinkRouter` + `LinkRouterHost`; hashtag links; chat linkifier; waits for a radio and for channel sync; invalid-link message | 4 |
| **A2 · Epic verification** ([#1290](https://github.com/OffbandMesh/meshcore-client/issues/1290)): on Android and Windows | 1 |
### Epic B: register `meshcore://` ([#1286](https://github.com/OffbandMesh/meshcore-client/issues/1286)), merged in #1308
| Task | Pts |
|---|---|
| **B1 · Platform registration** ([#1291](https://github.com/OffbandMesh/meshcore-client/issues/1291)): Android intent filter, iOS and macOS URL types, `app_links` | 3 |
| **B2 · Epic verification** ([#1292](https://github.com/OffbandMesh/meshcore-client/issues/1292)): passed on the S26 Ultra 2026-11-29 | 1 |
### Epic C: offband.app App Links and Universal Links ([#1287](https://github.com/OffbandMesh/meshcore-client/issues/1287))
| Task | Pts |
|---|---|
| **C1 · Build** ([#1309](https://github.com/OffbandMesh/meshcore-client/issues/1309)): the https form in the router; `assetlinks.json` and `apple-app-site-association` in `web/.well-known/`, served as JSON; Android `autoVerify` filter; iOS `Runner.entitlements`; web client reads and clears the fragment; CI check of both files | 4 |
| **C2 · Epic verification** ([#1310](https://github.com/OffbandMesh/meshcore-client/issues/1310)): `pm get-app-links` reports verified; https links open the app on Android and the web client on desktop | 1 |
### Epic D: Share and Copy Link emit the offband.app link ([#1288](https://github.com/OffbandMesh/meshcore-client/issues/1288))
| Task | Pts |
|---|---|
| **D1 · Build** ([#1311](https://github.com/OffbandMesh/meshcore-client/issues/1311)): https form beside `toShareUri` / `buildShareUri`; every Share and Copy Link uses it; every parser accepts both forms | 3 |
| **D2 · Epic verification** ([#1312](https://github.com/OffbandMesh/meshcore-client/issues/1312)) | 1 |
### Epic E: Integration Testing ([#1313](https://github.com/OffbandMesh/meshcore-client/issues/1313))
| Task | Pts |
|---|---|
| **E1 · Integration test matrix** ([#1314](https://github.com/OffbandMesh/meshcore-client/issues/1314)): share on one device, open on another; QR, Share and Copy Link; from a browser, a messaging app and an Offband chat; app closed, open and with no radio; Android, iOS, web; the stock app scanning an Offband QR | 3 |
| **E2 · OUTCOMES.md** ([#1315](https://github.com/OffbandMesh/meshcore-client/issues/1315)) beside this plan | 1 |
## 4. Order and dependencies
A → B → C → D → E, chained in Citadel (each Epic's verification blocks the next Epic; E depends on A to D).
- C needs A's router and B's platform setup.
- D needs C: there is no point emitting https links until they open the app.
- C and D both touch `lib/services/link_router.dart` and the share helpers, so they run in that order, not in parallel.
- C's Android and web parts don't wait on Apple. The iOS part needs your new profile (owner steps, below).
## 5. Grants and authorization
| Term | Proposed | Why |
|---|---|---|
| **What merging this plan authorizes** | Building Epics C, D and E as written, one PR per Epic, with no stop between them | The design and the decisions are settled here |
| **Merges** | Held to the end of the Feature. You test the finished thing and merge C, D and E | CLAUDE-BASE: hold merges to the end of the chain |
| **Epic verification** | Owner, on hardware | Link routing is OS behavior; CI cannot prove it |
| **Owner steps during the run** | The three in §9 rows 3 to 5, sent as one message when C reaches iOS | Android and web don't need them |
| **Stops** | A CI failure I can't fix, or anything outside this plan | |
| **Flash** | None | No firmware involved |
```grant-terms
{
"epic_chain": [1287, 1288, 1313],
"chain": true,
"verification": { "mode": "owner" },
"merge": { "budget": 3, "basis": "One PR per remaining Epic: C (#1287), D (#1288), E (#1313). A and B already merged in #1308." },
"flash": null,
"reset": null,
"expires_after_hours": 168
}
```
## 6. Can't-tell branches
| Where | Can't tell what | Does |
|---|---|---|
| `parseShareLink` | Link doesn't parse, or is an advert over 255 bytes | **stop**: persistent "not a valid link" message |
| `handleFromOs` | Scheme isn't `meshcore`, or https host isn't offband.app / dev.offband.app, or path isn't `/add/...` | **stop**: ignored, since an ordinary launch or the web page's own address is not a request |
| `LinkRouterHost` | No radio connected | **ask**: holds the link with a "connect a radio" message, shows the confirmation on connect |
| `LinkRouterHost` | Channel table mid-sync | **ask**: waits for the sync before the duplicate check |
| `confirmAndAddSharedChannel` | Channel already on the radio (same key) | **stop**: "already added" |
| `confirmAndAddSharedChannel` | No free slot, or the radio doesn't confirm the write | **stop**: explains, writes nothing more |
| Web client | Fragment missing or malformed | **stop**: invalid-link message, nothing added |
| OS domain verification | `assetlinks.json` or AASA unreachable or wrong | **stop**: the OS opens the web client instead of the app. Caught by the C2 check |
No fail-open branches.
## 7. Verification
- **Named command:** `flutter analyze` and `flutter test`, output in every Epic PR.
- **Acceptance bar:** the router, linkifier, channel-URI and platform-registration tests from A and B stay green; C adds the https-form, entitlements and verification-file tests; D adds the round-trip and Share-emits-https tests. Each fails first against `dev`.
## 8. Done when
- An https link opens Offband on Android with no chooser, and `pm get-app-links` reports the domain verified.
- The same link opens the web client in a desktop browser, and on iOS opens the app once the profile is in place.
- Share and Copy Link emit the https link; QR codes still scan in the stock app.
- E1 passes and E2 is approved.
## 9. Your choices
⭐ marks the recommendation.
| # | Question | Option A | Option B | Rec. | Your choice |
|---|---|---|---|---|---|
| 1 | Should the app also claim dev.offband.app? | Yes, so test builds verify against dev.offband.app before a release | No, offband.app only, and C2 waits for the next deploy from main | ⭐ A | |
| 2 | After the web client reads a link, clear the fragment from the address bar? | Yes, a reload asks nothing | No, leave the address as is | ⭐ A | |
| 3 | Play Console → Setup → App signing: does the app signing key SHA-256 read `E7:DA:8C:D5:…:AF:54:88`? | Yes | No (send me the value shown) | | |
| 4 | Turn on Associated Domains for `app.offband.meshcore` in the Apple portal and send me the new App Store profile? | Yes, I'll update `APPLE_PROFILE_BASE64` | Defer iOS: C ships Android and web, iOS follows | ⭐ A | |
| 5 | Apple Team ID (Membership page), for the AASA file | (value) | | | |
## 10. Carried-in work
| Item | Goes to |
|---|---|
| A and B shipped together in one PR (#1308) instead of one per Epic, before this plan existed | Recorded here; A's Epic verification #1290 is still open and runs before C's PR |
| Windows and Linux `meshcore://` registration | #1284 / installer epic #1294 |
| Show the scope an incoming message arrived with (Dot) | #1307, separate Feature |
## Decisions
| Decision | Where |
|---|---|
| Windows auto-registers the protocol, with a switch to turn it off | #1280 comment, follows #1284 |
| QR codes stay `meshcore://`; Share and Copy Link emit the https link | #1280 comment |
| Order A, B, C, D | #1280 comment |
| Link fields go after `#` so secrets never reach the server or its logs | #1287 |
| An advert link is at most 255 bytes | #1308 review |
## Alternatives considered but not chosen
- **Query string instead of fragment for the https form:** the channel secret would land in Cloudflare's logs.
- **Share emits `meshcore://`:** the stock app competes for it, so taps hit a chooser.
- **A separate verification host (e.g. links.offband.app):** a second Pages project and DNS for no gain over offband.app.
Loading…
Cancel
Save

Powered by TurnKey Linux.