Commit Graph

5 Commits

Author SHA1 Message Date
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
275ad4be4a feat(relay): add NIP-ER push scheduler, ingest relaxation, and NIP-11 advertisement
The relay now proactively delivers due reminders via Redis pub/sub.
Cross-pod dedup uses an atomic delivered_at claim (mirrors the reaper's
archived_at guard). Ingest relaxed to allow kind:30300 without
not_before (bookmarks/terminal states). max_not_before_delta enforced
to prevent unbounded-future scheduling abuse.

Schema: nullable not_before + delivered_at columns on events, partial
index for scheduler queries. NIP-11: supported_extensions ["nip-er"],
due_delivery_mode "push", max_not_before_delta advertised.

Spec (NIP-ER.md) amended: not_before optional on kind:30300, required
only for pending reminders that may become due.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-11 15:31:10 -04:00
Will Pfleger
f319f2fae5 style: fix formatting in e2e_event_reminder.rs 2026-06-11 15:25:04 -04:00
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
84b0dadee3 fix(relay): relax not_before to optional, add d-tag validation
The spec requires not_before on pending reminders only — terminal states
(done/cancelled) and bookmarks omit it. The validator incorrectly
required exactly one not_before on all kind:30300 events, blocking the
entire completion/cancellation lifecycle.

Also adds d-tag structure validation per spec: reject zero, empty, or
duplicate d tags.

Co-authored-by: Will Pfleger <will@pfleger.dev>
Signed-off-by: Will Pfleger <will@pfleger.dev>
2026-06-11 15:10:01 -04:00
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
0b3bed62bf feat(relay): implement NIP-ER event reminder support (kind:30300)
Adds relay-side support for NIP-ER encrypted event reminders:

Write path (ingest):
- Register KIND_EVENT_REMINDER (30300) as parameterized replaceable,
  global-only, and UsersWrite-scoped
- Validate not_before tag: exactly one, decimal digits only, no leading
  zeros, range 0..=MAX_SAFE_INTEGER
- Reject expiration <= not_before when both are present and parseable

Read path (REQ/COUNT/bridge):
- AUTHOR_ONLY_KINDS array gates visibility — only the authenticated
  event author may read kind:30300 events
- Exclusive author-only filters (kinds:[30300]) require authors=[self]
  or get CLOSED/403
- Mixed-kind filters pass the gate but per-event filtering silently
  omits other authors' reminders
- COUNT fast path disabled when author-only kinds are in play to
  prevent leaking aggregate counts

Integration tests (e2e_event_reminder.rs):
- Write validation: valid, missing, duplicate, malformed not_before;
  expiration ordering; edge cases (0, MAX_SAFE_INTEGER)
- Read filtering: author self-query, cross-user rejection (HTTP 403
  and WS CLOSED), mixed-kind omission, replacement semantics

Signed-off-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Will Pfleger <wpfleger@squareup.com>
Signed-off-by: Will Pfleger <wpfleger@squareup.com>
2026-06-11 15:10:01 -04:00
Will Pfleger
d99ad131f1 refactor: rename sprout backend to buzz (#958)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Signed-off-by: Will Pfleger <wpfleger@squareup.com>
Signed-off-by: Will Pfleger <wpfleger96@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw <4a1bfa0013bc6d14a8d600d8bf6392efefbd2a26ac3c96c9b2a106b0d12297ca@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: npub16v54tttfqacx9ycvc3k0ut0npj564ahcuajzy6qjvh57ntmsf4uq4806j2 <d32955ad69077062930cc46cfe2df30ca9aaf6f8e76422681265e9e9af704d78@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Will Pfleger <wpfleger96@gmail.com>
2026-06-10 19:29:51 -04:00