Skip to content

Fix events revalidation bugs: wrong block mappings and missing relationship queries#1023

Open
busbyk wants to merge 2 commits intomainfrom
fix/events-block-mappings
Open

Fix events revalidation bugs: wrong block mappings and missing relationship queries#1023
busbyk wants to merge 2 commits intomainfrom
fix/events-block-mappings

Conversation

@busbyk
Copy link
Copy Markdown
Collaborator

@busbyk busbyk commented Apr 6, 2026

Description

Fixes two bugs in the revalidation system where the events collection was not being properly tracked:

  1. eventsBlockMappings was incorrectly using postsBlocks instead of eventsBlocks
  2. The events collection was completely omitted from relationship reference tracking and queries in findDocumentsWithRelationshipReferences

Related Issues

Discovered during #455 work. Using a phased approach for the new revalidation system so fixing this while we're still on the old system.

Key Changes

  • src/utilities/getBlocksFromConfig.ts — Fix eventsBlockMappings to use eventsBlocks instead of postsBlocks
  • src/utilities/getRelationshipsFromConfig.ts — Add events collection to relationship config extraction
  • src/utilities/revalidation/findDocumentsWithRelationshipReferences.ts — Add events collection to relationship reference queries with proper block and relationship field handling

How to test

  1. Create an event that references another document (e.g., a page or post via a link block)
  2. Edit the referenced document
  3. Verify the event page is revalidated (appears in revalidation logs and new related content appears)

Screenshots / Demo video

https://www.loom.com/share/fa0a27d9240f4e42ba7c68568213bfae

Migration Explanation

No migration needed.

Future enhancements / Questions

This revalidation system will be replaced but fixing for now.

…onship queries

eventsBlockMappings was using postsBlocks instead of eventsBlocks, and the events
collection was completely omitted from relationship reference tracking and queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Preview deployment: https://fixxevents-block-mappings.preview.avy-fx.org

…improve error logging

Events was importing populateBlocksInContent from Posts (using postsBlockMappings).
Now uses its own hook with eventsBlockMappings. Also log Drizzle error cause
in block reference queries to help diagnose transient query failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@busbyk busbyk marked this pull request as ready for review April 7, 2026 22:15
@busbyk busbyk requested a review from rchlfryn April 7, 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.

2 participants