Skip to content

feat: schema mapping, delete fix, and gap closures CEP-6#81

Open
harsh04044 wants to merge 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep6-pr4-integration-tests-cleanup
Open

feat: schema mapping, delete fix, and gap closures CEP-6#81
harsh04044 wants to merge 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep6-pr4-integration-tests-cleanup

Conversation

@harsh04044
Copy link
Copy Markdown

@harsh04044 harsh04044 commented May 21, 2026

Final PR closing CEP-6 implementation #76.

What's in this PR:

Schema-to-kind mapping table - replaced the field-presence if-else chain in handle_announcement_response() with a typed mapping table. Each entry validates field types (arrays must be arrays, strings must be strings), matching TS SDK's safeParse semantics. Rejects malformed payloads like {"tools": null}.

Delete fix - delete_announcements() now fetches existing events per kind via fetch_events() and publishes kind 5 with ["e", event_id] tags for each found event. Added fetch_events() to RelayPoolTrait and MockRelayPool.

Integration tests - roundtrip publish→discover for all 5 kinds, delete tag format verification, schema rejection tests.

Gap closures - 5 tests added for CEP-6 parity with TS SDK:

  • profile metadata custom field preservation through kind 0 content
  • profile metadata error resilience (no panic on publish failure)
  • private server publishes relay list but not announcements
  • relay_list_urls and bootstrap_relay_urls are independent
  • profile metadata published regardless of is_announced_server

Also fixed a wrong integration test that expected the old ["k", kind] deletion behavior.

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