feat: switch NIP-AC from GiftWrap with expiration to EphemeralGiftWrap

Use EphemeralGiftWrapEvent (kind 21059) instead of GiftWrapEvent (kind
1059) for WebRTC call signaling. The ephemeral kind signals to relays
that these events are transient and should not be persisted, eliminating
the need for expiration tags on both inner signaling events and outer
wraps.

Changes:
- Remove expiration tags from all 6 call event types (25050-25055)
- Switch WebRtcCallFactory to produce EphemeralGiftWrapEvent wraps
- Update CallManager and CallController publishEvent types
- Update Account.publishCallSignaling signature
- Use CallManager.MAX_EVENT_AGE_SECONDS for staleness checks
- Update NIP-AC spec to document EphemeralGiftWrap usage
- Remove expiration-related tests

https://claude.ai/code/session_014kyBgZx7cNyeUXYWV25M4j
This commit is contained in:
Claude
2026-04-03 22:11:19 +00:00
parent 01618e71fc
commit 799ebd692f
13 changed files with 62 additions and 143 deletions
@@ -103,25 +103,6 @@ class CallEventsTest {
assertEquals("recipient-hex-key", pTag?.get(1))
}
@Test
fun callOfferBuildIncludesExpirationTag() {
val template =
CallOfferEvent.build(
sdpOffer = "sdp",
calleePubKey = "abc",
callId = "id",
type = CallType.VOICE,
createdAt = 1000L,
)
val expirationTag = template.tags.firstOrNull { it[0] == "expiration" }
assertEquals((1000L + CallOfferEvent.EXPIRATION_SECONDS).toString(), expirationTag?.get(1))
}
@Test
fun callOfferExpirationIs20Seconds() {
assertEquals(20L, CallOfferEvent.EXPIRATION_SECONDS)
}
@Test
fun callAnswerBuildContainsSdp() {
val template =
@@ -235,20 +216,6 @@ class CallEventsTest {
assertEquals("video", callTypeTag?.get(1))
}
@Test
fun groupCallOfferBuildIncludesExpirationTag() {
val template =
CallOfferEvent.build(
sdpOffer = "sdp",
calleePubKeys = setOf("alice", "bob"),
callId = "id",
type = CallType.VOICE,
createdAt = 2000L,
)
val expirationTag = template.tags.firstOrNull { it[0] == "expiration" }
assertEquals((2000L + CallOfferEvent.EXPIRATION_SECONDS).toString(), expirationTag?.get(1))
}
@Test
fun groupCallAnswerBuildIncludesAllPTags() {
val members = setOf("alice", "bob", "carol")