Skip to content

fix: Multiple tag selections for dedup key in parameterized evetns#525

Merged
cameri merged 2 commits intocameri:mainfrom
kushagra0902:dedupFix
Apr 19, 2026
Merged

fix: Multiple tag selections for dedup key in parameterized evetns#525
cameri merged 2 commits intocameri:mainfrom
kushagra0902:dedupFix

Conversation

@kushagra0902
Copy link
Copy Markdown
Collaborator

Description

Migrations for removing multiple dedup keys and bugged import path from importer is fixed so to take jsut the first index for keys.

Related Issue

#478

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

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.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Copilot AI review requested due to automatic review settings April 19, 2026 07:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes NIP-33 parameterized replaceable event deduplication handling so only the first d tag value is used (matching expected spec behavior), and normalizes existing stored data accordingly.

Changes:

  • Normalize importer-side deduplication enrichment to store only the first d tag value.
  • Add a migration to collapse existing event_deduplication arrays to a single value and delete now-duplicate rows.
  • Add a unit test to ensure batch persistence normalizes parameterized deduplication to a single key.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/unit/services/event-import-service.spec.ts Adds a unit test asserting parameterized deduplication is reduced to the first d tag value during batch persistence.
src/services/event-import-service.ts Changes parameterized dedup extraction to use only the first d tag value and stores it as a single-element array.
migrations/20260419_140000_normalize_parameterized_deduplication.js Normalizes existing DB rows to single-value dedup keys and removes duplicates that would conflict after normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 19, 2026

Coverage Status

coverage: 69.016% (+0.7%) from 68.308% — kushagra0902:dedupFix into cameri:main

@kushagra0902 kushagra0902 changed the title Dedup fix fix: Multiple tag selections for dedup key in parameterized evetns Apr 19, 2026
@cameri cameri merged commit b09e23a into cameri:main Apr 19, 2026
13 of 14 checks passed
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.

4 participants