Commit graph

4 commits

Author SHA1 Message Date
mplorentz
2088e1be4b Fix web ui error 2026-08-25 14:43:00 -04:00
Agent
4e6030f3c2 fix: guard deleteAlert and publishAlert against undefined relay
NOTIFIER_RELAY is string | undefined after the earlier guard fix.
deleteAlert and publishAlert passed it directly to publish() which
expects string[]. Add early-return guards to both functions.

Fixes the 2 new TS2322 errors introduced by the previous commit.
2026-08-24 18:22:46 -04:00
Agent
57f7d94669 fix: guard normalizeRelayUrl against undefined env var
The web UI crashed on load when VITE_NOTIFIER_RELAY was not set
because normalizeRelayUrl(undefined) calls url.match(...) on the
undefined argument, producing:
  TypeError: can't access property 'match', A is undefined

Fix: guard with a truthy check before calling normalizeRelayUrl,
and early-return from loadAlerts when NOTIFIER_RELAY is undefined.

Fixes bead mailship-4ic
2026-08-24 18:21:00 -04:00
Agent
21e7058862 Initial mailship fork from anchor
Fork anchor, strip all push notification code (APNs, FCM, WebPush),
rename from anchor to mailship, add new database schema for
subscriptions + events tables, and add HTTP API for email
notification registration and NIP-9a relay push callbacks.

- POST /subscription/email — register for email digests
- DELETE /subscription/:key — unsubscribe
- POST /notify/:id — NIP-9a relay push callback
- GET /confirm?token=... — confirm email
- GET /unsubscribe?token=... — unsubscribe

Co-authored-by: mplorentz
2026-08-18 12:21:22 -04:00