Skip to content

fix: set event_deduplication in seed script#386

Merged
cameri merged 1 commit intocameri:mainfrom
kanishka0411:fix/seed-event-deduplication
Apr 8, 2026
Merged

fix: set event_deduplication in seed script#386
cameri merged 1 commit intocameri:mainfrom
kanishka0411:fix/seed-event-deduplication

Conversation

@kanishka0411
Copy link
Copy Markdown
Contributor

Description

Seed script wasn't setting event_deduplication. Added a helper to compute it the same way upsert() does[pubkey, kind]for replaceable events, d tag values for parameterized replaceable ones.
event_delegator is no longer handled since it was removed in migration 20240111204900.

Fixes #135

Motivation and Context

Seeded events should match the same state as events inserted through the relay at runtime. Without event_deduplication, the unique index on replaceable events doesn't work correctly for seeded data.

How Has This Been Tested?

  • Verified the deduplication logic matches EventRepository.upsert() and ParameterizedReplaceableEventStrategy
  • Confirmed no duplicate dedup keys among seed data

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • All new and existing tests passed.

@cameri cameri merged commit ed1e588 into cameri:main Apr 8, 2026
7 of 10 checks passed
@cameri
Copy link
Copy Markdown
Owner

cameri commented Apr 8, 2026

Thank you @kanishka0411 !

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.

[BUG] Update seed script to set event_delegator and event_deduplication

2 participants