Skip to content

feat(relay): Add a personal background relay for APNs - #95

Draft
mwolson wants to merge 1 commit into
personal/mobile-thread-pr-buttonfrom
personal/background-relay-service
Draft

mwolson wants to merge 1 commit into
personal/mobile-thread-pr-buttonfrom
personal/background-relay-service

Conversation

@mwolson

@mwolson mwolson commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Problem

T3's hosted relay signs APNs requests with T3 Tools' key, so it cannot reach my personally signed iOS build (com.mwolson.t3code.v2.dev). Push notifications and Live Activities for that build need a relay that holds my own key.

Change

Adds infra/personal-relay, a background-only APNs relay for my personal iOS build, served at t3-relay.mikemail.work. It runs on Node 26.12.1 with Postgres. It accepts device and Live Activity registrations from my T3 sign-in (Clerk JWKS pinned to my account, then DPoP) and signed activity publishes from enrolled environments. A separate admin CLI enrolls environments with a proof from each host and lists or revokes them; enrollment is not part of the public HTTP API. Delivery uses a Postgres alert ledger with per-device and per-channel retries, device backfill on registration and bounded APNs payloads, sent over Node HTTP/2. The relay reuses the hosted relay's runtime services and supplies its own account worker, delivery ledger and transport.

On the server side, completion alerts take their eligibility time from durable orchestration events, so a completion held by background work, monitors, a monitor holding a background wake, or PR watches alerts when the hold releases. The publish sequence survives restarts, so retries keep their transition identity and order.

T3 Connect discovery, connections and tunnels stay on relay.t3.codes. Deployment manifests and sealed secrets live in my webserver repo, not here.

Scope

Personal layer, fork-only. It exists for my own signing setup and will never be proposed upstream.

Verification

Run on zbook26. Focused tests at the layer pass: 59 server, 1 shared, 1 relay-queue and 67 personal-relay tests, plus 19 database tests across six files against a throwaway PostgreSQL 17 container. With the production change reverted, the public enrollment-proof command test and the signed durable attention-request identity and time test fail. The long-held completion table gains a monitor_wake row, which fails without the monitor wake hold (eligibility stays at 15 minutes instead of the monitor's release at 20 minutes 5 seconds); the completion-eligibility and relay files pass all 42 tests with it.

No relay image was built, pushed or deployed for this version, and no deployed relay or phone was contacted.

Known Limitations

The relay image and its README pin node:26.12.1-alpine, while the repository's engine is now Node 26.13.1, so the bundle built with the newer toolchain runs on the older patch release until the image is moved up.

@mwolson
mwolson added this pull request to stack #96 October 17, 2026 23:05
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 061d0a4 to 9ad2ab2 Compare October 22, 2026 03:11
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 9ad2ab2 to 685f93e Compare October 22, 2026 04:53
@mwolson
mwolson removed this pull request from stack #96 October 22, 2026 04:53
@mwolson
mwolson added this pull request to stack #99 October 22, 2026 04:54
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 685f93e to a39c464 Compare October 23, 2026 23:19
@mwolson
mwolson force-pushed the personal/background-relay-service branch from a39c464 to 8f9fa47 Compare October 24, 2026 00:11
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 8f9fa47 to 0851ae6 Compare October 24, 2026 00:38
@mwolson
mwolson removed this pull request from stack #99 October 24, 2026 01:36
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 0851ae6 to 7400dd7 Compare October 24, 2026 01:36
@mwolson
mwolson added this pull request to stack #101 October 24, 2026 01:36
@mwolson
mwolson force-pushed the personal/background-relay-service branch 2 times, most recently from e53355f to f351ff0 Compare October 24, 2026 19:49
@mwolson
mwolson removed this pull request from stack #101 October 24, 2026 19:49
@mwolson
mwolson added this pull request to stack #103 October 24, 2026 19:50
@mwolson
mwolson removed this pull request from stack #103 October 29, 2026 11:33
@mwolson
mwolson force-pushed the personal/background-relay-service branch from f351ff0 to 8b37820 Compare October 29, 2026 11:33
@mwolson
mwolson added this pull request to stack #104 October 29, 2026 11:34
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 8b37820 to 39eeaf6 Compare October 29, 2026 13:24
@mwolson
mwolson removed this pull request from stack #104 October 30, 2026 00:23
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 39eeaf6 to 063ee50 Compare October 30, 2026 00:23
@mwolson
mwolson removed this pull request from stack #110 November 9, 2026 22:52
@mwolson
mwolson added this pull request to stack #112 November 9, 2026 22:52
@mwolson
mwolson removed this pull request from stack #112 November 10, 2026 03:11
@mwolson
mwolson force-pushed the personal/background-relay-service branch from c3cfcfc to 9a85b52 Compare November 10, 2026 03:11
@mwolson
mwolson added this pull request to stack #113 November 10, 2026 03:12
@mwolson
mwolson removed this pull request from stack #113 November 10, 2026 06:59
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 9a85b52 to 26a6900 Compare November 10, 2026 06:59
@mwolson
mwolson added this pull request to stack #117 November 10, 2026 07:00
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 26a6900 to 1107788 Compare November 10, 2026 07:34
@mwolson
mwolson removed this pull request from stack #117 November 10, 2026 07:35
@mwolson
mwolson added this pull request to stack #119 November 10, 2026 07:35
@mwolson
mwolson removed this pull request from stack #119 November 10, 2026 14:59
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 1107788 to c9f6dd5 Compare November 10, 2026 14:59
@mwolson
mwolson added this pull request to stack #121 November 10, 2026 14:59
@mwolson
mwolson force-pushed the personal/background-relay-service branch from c9f6dd5 to 8c1a3fd Compare November 10, 2026 16:19
@mwolson
mwolson removed this pull request from stack #121 November 10, 2026 21:17
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 8c1a3fd to 36f68e5 Compare November 10, 2026 21:17
@mwolson
mwolson added this pull request to stack #123 November 10, 2026 21:17
@mwolson
mwolson removed this pull request from stack #123 November 11, 2026 23:29
@mwolson
mwolson force-pushed the personal/background-relay-service branch from 36f68e5 to c994e49 Compare November 11, 2026 23:29
@mwolson
mwolson added this pull request to stack #125 November 11, 2026 23:30
@mwolson
mwolson removed this pull request from stack #125 November 12, 2026 00:24
Add a background-only APNs relay on Node 26.12.1 with Postgres for Mike's
personal iOS build, served at t3-relay.mikemail.work. Environment
enrollment and a separate admin CLI keep bootstrap and diagnostics out
of the public HTTP API.

Derive completion eligibility from durable server events and persist the
publish sequence across restarts, so held completions can alert when
released while retries retain their transition identity and ordering.

This layer is fork-only. It reuses the hosted relay's runtime services
and supplies its own account worker, delivery ledger and Node HTTP/2
transport. Local tests generate their TLS keys and certificates at runtime.

This branch has not been deployed

No deployments
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.

1 participant