{
"id":"820081f1a48dbfc9cc606b0a61deee2f59817642503648ca1cb9fb9851b091c3",
"pubkey":"b3c95ce33dfa84326611e8b7a9c10b78df28754c38b106a4bc0196b9be5f4e4a",
"created_at":1786366513,
"kind":1618,
"tags": [
[
"a",
"30617:7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19:Amber",
"wss://relay.ngit.dev"
],
[
"subject",
"feat(unified-push): receive NIP-46 requests over UnifiedPush (ambersocket)"
],
[
"alt",
"git Pull Request: feat(unified-push): receive NIP-46 requests over UnifiedPush (ambersocket)"
],
[
"branch-name",
"unified-push"
],
[
"r",
"2b2cdda46b9d0e0b35e565e8f8b2b066f5ffd141"
],
[
"c",
"03f15483dd42d251946f2ce565458b201a89973a"
],
[
"clone",
"https://relay.ngit.dev/npub1w4uswmv6lu9yel005l3qgheysmr7tk9uvwluddznju3nuxalevvs2d0jr5/Amber.git"
],
[
"merge-base",
"65fea7d6b329597ead4051cab67ef5df4bbb2cc9"
],
[
"p",
"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19"
]
],
"content":"Adds v1 of UnifiedPush-based NIP-46 delivery on the free/benchmark flavors.\nAmber no longer needs the always-on foreground service when UnifiedPush is\nenabled: the companion ambersocket daemon (a self-hosted Rust service built\non nostr-sdk) watches relays for kind 24133 and wakes Amber via UnifiedPush\nfor each inbound request. The daemon only forwards the raw event verbatim and\nnever holds keys — only Amber can decrypt (NIP-04/NIP-44) and sign. Requires\na UnifiedPush distributor (e.g. ntfy) on the device plus a running\nambersocket instance, which is configured by pasting the config this feature\ncopies to the clipboard.\n\nambersocket implementation: https://gitworkshop.dev/npub1k0y4eceal2zryes3azm6nsgt0r0jsa2v8zcsdf9uqxttn0jlfe9q04c9h8/grasp.t5.st/ambersocket\nWire contract (ambersocket -\u003e Amber) lives in UnifiedPushPayload.kt; the\ndaemon emits exactly what the parser accepts and nothing else (push when the\nbody is \u003c= 4096 bytes, ping otherwise).\n\nWhat's new\n- Add unifiedpush-android-connector dependency (free + benchmark only) and\n exclude tink-android from security-crypto to avoid duplicate Tink classes.\n- Add AmberSettings fields (unifiedPushEnabled/endpoint/status/distributor),\n the UnifiedPushStatus enum, and SharedPreferences persistence.\n- Add UnifiedPushService (PushService subclass) with onMessage\n (nostr-event -\u003e EventNotificationConsumer, ping -\u003e relay refresh),\n onNewEndpoint, onRegistrationFailed and onUnregistered; registered in the\n free/benchmark manifests with the PUSH_EVENT intent filter.\n- Add UnifiedPushPayload: parses the ambersocket wire contract (version 1,\n type \"nostr-event\" | \"ping\"), silently ignoring malformed/unknown payloads.\n- Add UnifiedPushConfig + Jackson serializer for the ambersocket pairing\n payload: endpoint, global relays, and per-account saved_relays plus\n per-connection pubkey_hex/relays (including empty-relay connections so the\n server can fall back to account/global relays).\n- Add UnifiedPushSettingsSection (toggle, status, endpoint, Copy config) to\n ServiceSettingsScreen; no-op stub on the offline flavor.\n- Add UnifiedPushBootstrap: re-registers with the saved distributor on cold\n start (after settings load, so a fast endpoint callback can't clobber\n persisted settings); non-interactive to avoid popping the picker.\n- Expose reactive unifiedPushEndpoint/unifiedPushStatus flows on Amber and\n skip the ConnectivityService foreground service when UnifiedPush is on.\n\nRobustness\n- Add Amber.ensureInitialized(): idempotent process-once initializer that\n funnels the FGS and UP wake paths through a single runMigrations run so a\n cold-started wake populates LocalKeyAccountIndex before consuming events,\n with a 60s timeout safety net so the broadcast handler can't hang if\n runMigrations swallows a non-fatal exception.\n- Thread ambersocket ping relay hints through updateFilter() /\n checkForNewRelaysAndUpdateAllFilters() as temporary (non-persisted)\n subscription relays for that refresh.\n- Copy config via the existing SensitiveClipboard helper (Android 13+\n sensitive flag + auto-clear), and never log the endpoint (bearer-style\n capability URL).\n\nTests\n- UnifiedPushPayloadTest: valid push/ping, relay normalization, malformed,\n unsupported-version and unknown-type rejection.\n- UnifiedPushConfigTest: JSON round-trip, fallback data and escaping.\n- NotificationSubscriptionTest: ping relay hints applied to connections\n without custom relays.\n- UnifiedPushConfigIntegrationTest (androidTest): runtime Jackson output and\n sensitive ClipData metadata on device.",
"sig":"31aa970591fb161e03f7bce1c3541976b6cae8d8c810e680079f49d54f4391ab3271c95a3692f1413099dc1b4bd07d611425538c3fb5244446a84047d7345d83"
}