Skip to content

(Optional) One-time cleanup of duplicate kind 0 rows in DynamoDB#75

Merged
alejandro-runner merged 1 commit intomainfrom
fix/71-cleanup-kind0-duplicates
Feb 3, 2026
Merged

(Optional) One-time cleanup of duplicate kind 0 rows in DynamoDB#75
alejandro-runner merged 1 commit intomainfrom
fix/71-cleanup-kind0-duplicates

Conversation

@alejandro-runner
Copy link
Member

Summary

After merging the Lambda and data-loader fixes (#68, #69), DynamoDB may still contain multiple kind 0 rows per pubkey from past runs. This adds a one-time cleanup script so the table can be normalized to one kind 0 per pubkey.

Changes

  • scripts/cleanup-kind0-duplicates.ts: Scans the table for kind=0, groups by pubkey, keeps the event with the largest created_at per pubkey, and deletes the others. Supports --dry-run to preview without deleting.
  • scripts/README.md: Documents when to run the script, how to use it (dry-run first, then apply), and required env (DYNAMODB_TABLE_NAME, AWS_REGION).
  • package.json: npm run cleanup:kind0:dry-run and npm run cleanup:kind0.

Do not run automatically in production; run explicitly after deploying the kind 0 replaceable fix. Prefer testing against a staging table first.

Closes #71

- scripts/cleanup-kind0-duplicates.ts: scan kind=0, keep latest per pubkey, delete rest
- --dry-run to preview; document in scripts/README.md
- npm run cleanup:kind0:dry-run | cleanup:kind0

Closes #71

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mcp-server Ready Ready Preview, Comment Feb 3, 2026 10:14pm

@alejandro-runner alejandro-runner merged commit 9b2d908 into main Feb 3, 2026
5 checks passed
@alejandro-runner alejandro-runner deleted the fix/71-cleanup-kind0-duplicates branch February 3, 2026 22:15
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.

(Optional) One-time cleanup of duplicate kind 0 rows in DynamoDB

1 participant