Skip to content

fix: add missing duplicate checks to all IPFS data source callers#163

Merged
hudsonhrh merged 1 commit intomainfrom
hudsonhrh/washington-v4
Apr 15, 2026
Merged

fix: add missing duplicate checks to all IPFS data source callers#163
hudsonhrh merged 1 commit intomainfrom
hudsonhrh/washington-v4

Conversation

@hudsonhrh
Copy link
Copy Markdown
Member

Summary

  • Five IPFS data source callers were missing existence checks before createWithContext, allowing duplicate data sources for the same CID in the same block
  • When duplicate handlers fire for immutable entities, both try to INSERT the same entity ID, crashing the indexer with "Failed to transact block operations" / WASM thread termination
  • Added duplicate checks in: org-registry.ts (OrgMetadata/OrgMetadataLink), education-hub.ts (EducationModuleMetadata), participation-token.ts (TokenRequestMetadata), task-manager.ts (TaskApplicationMetadata), universal-account-registry.ts (AccountMetadata)

This completes the pattern already used by hybrid-voting.ts, direct-democracy-voting.ts, eligibility-module.ts, task-manager.ts (TaskMetadata/ProjectMetadata) — all IPFS data source callers now check before creating.

Test plan

  • npm run codegen passes
  • npm run build passes
  • All 241 tests pass
  • subgraph-lint passes (0 errors)
  • Redeploy subgraph and verify it indexes past the previously failing block

🤖 Generated with Claude Code

Five callers were creating IPFS file data sources without checking if the
metadata entity already exists. When the same CID triggers multiple times
in the same block (e.g., during org deployment with 145+ events), duplicate
data source handlers fire and both try to INSERT the same immutable entity,
crashing the indexer with "Failed to transact block operations".

Added existence checks before createWithContext in:
- org-registry.ts (OrgMetadata — protects immutable OrgMetadataLink children)
- education-hub.ts (EducationModuleMetadata — immutable)
- participation-token.ts (TokenRequestMetadata — immutable)
- task-manager.ts (TaskApplicationMetadata — immutable)
- universal-account-registry.ts (AccountMetadata — defensive)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hudsonhrh hudsonhrh merged commit 842c247 into main Apr 15, 2026
5 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.

1 participant