Skip to content

chg(properties): simpler query, use properties in frontmatter, invalidatations#953

Merged
synoet merged 5 commits intomainfrom
synoet/properties-query-invalidations
Jan 13, 2026
Merged

chg(properties): simpler query, use properties in frontmatter, invalidatations#953
synoet merged 5 commits intomainfrom
synoet/properties-query-invalidations

Conversation

@synoet
Copy link
Copy Markdown
Contributor

@synoet synoet commented Jan 13, 2026

  • Removes the commplex caching logic we have setup
  • Makes frontmatter of blocks use a tanstack query instead of calling service directly
  • issues proper invalidations when updating a property from the frontmatter

@synoet synoet requested a review from a team as a code owner January 13, 2026 00:20
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 13, 2026

@macro-inc macro-inc deleted a comment from claude bot Jan 13, 2026
@synoet synoet closed this Jan 13, 2026
@synoet synoet reopened this Jan 13, 2026
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 13, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 13, 2026

Code review

I found debug console.log statements that should be removed before merging.

Issue: Debug console.log statements in production code

Two debug console.log statements were left in the new query file:

File: js/app/packages/queries/properties/entity.ts

  1. Line 42 - console.log(queryKey); in the bulkIncludesEntityPredicate function
  2. Line 59 - console.log('invalidate'); in the invalidatePropertiesForEntity function

Why this is an issue:

According to CLAUDE.md#L20, the guideline mentions using console.trace for debugging, but these console.log statements appear to be leftover debug code that will pollute the browser console in production.

Suggested fix:

Remove both console.log statements:

// Line 42 - Remove this line
function bulkIncludesEntityPredicate(queryKey: QueryKey, entityId: string) {
  console.log(queryKey); // <-- Remove
  return (
    queryKey.includes('properties') &&
    queryKey.includes('bulk') &&
    queryKey.some(
      (subKey) => Array.isArray(subKey) && subKey.includes(entityId)
    )
  );
}

// Line 59 - Remove this line
export function invalidatePropertiesForEntity(
  entityType: EntityType,
  entityId: string
) {
  console.log('invalidate'); // <-- Remove
  queryClient.invalidateQueries({
    queryKey: propertiesKeys.entity({ entityType, entityId }).queryKey,
  });
  // ...
}

Otherwise, the PR looks good! The migration to TanStack Query is well-structured and follows the codebase patterns.

@synoet synoet merged commit c4551f9 into main Jan 13, 2026
9 checks passed
@synoet synoet deleted the synoet/properties-query-invalidations branch January 13, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants