Skip to content

Comments

fix(logs): replace initialData with placeholderData to fix stale log details#3279

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/logs
Feb 21, 2026
Merged

fix(logs): replace initialData with placeholderData to fix stale log details#3279
waleedlatif1 merged 1 commit intostagingfrom
fix/logs

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Replaced initialData from list cache with placeholderData: keepPreviousData in useLogDetail
  • initialData with initialDataUpdatedAt: 0 was seeding the detail cache with incomplete list data, requiring a hard refresh to see full log details
  • Hover prefetch still works for instant detail rendering

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 21, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 21, 2026 0:58am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 21, 2026

Greptile Summary

Replaced initialData with placeholderData: keepPreviousData in the useLogDetail hook to prevent seeding the detail cache with incomplete list data, fixing an issue where log details were stale and required a hard refresh.

  • Removed the initialData function that populated detail cache from list query data
  • Removed initialDataUpdatedAt: 0 that was causing all seeded data to appear stale immediately
  • Switched to placeholderData: keepPreviousData to show previous data during refetch without polluting cache
  • Removed unused useQueryClient import
  • Hover prefetch functionality remains intact for instant detail rendering

Confidence Score: 5/5

  • Safe to merge - this is a well-understood fix for a specific TanStack Query data caching issue
  • The change correctly addresses the root cause by using placeholderData instead of initialData, which is the recommended pattern when you want to show previous data without affecting cache validity. The fix removes the problematic initialDataUpdatedAt: 0 pattern that was making all seeded data immediately stale.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/hooks/queries/logs.ts Replaced initialData with placeholderData: keepPreviousData in useLogDetail to fix stale data bug, removed unused useQueryClient import

Last reviewed commit: d115751

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit a1400ca into staging Feb 21, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/logs branch February 21, 2026 01:01
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