Skip to content

Fix cache invalidation#631

Merged
feruzm merged 1 commit into
developfrom
invalidate
Jan 26, 2026
Merged

Fix cache invalidation#631
feruzm merged 1 commit into
developfrom
invalidate

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Jan 26, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed cache synchronization when deleting gallery images and fragments to ensure changes are reflected across all pages of paginated content.
    • Improved consistency when adding and editing fragments across pagination.
  • Chores

    • Updated SDK version to 1.5.17.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

This PR synchronizes cache updates across both regular and infinite query caches for gallery image and fragment mutations. When images or fragments are added, edited, or deleted, mutations now update both cache types to maintain consistency across paginated results.

Changes

Cohort / File(s) Summary
Gallery Image Cache Synchronization
apps/web/src/api/mutations/gallery-image.ts
Added infinite query cache invalidation alongside regular cache updates on image deletion. Now removes deleted images from all pages of the infinite query cache keyed by ["posts", "images", "infinite", username].
Fragment Mutation Cache Synchronization
packages/sdk/src/modules/posts/mutations/add-fragment.ts, edit-fragment.ts, remove-fragment.ts
Expanded cache management for all fragment mutations (add/edit/remove) to update both regular fragment caches and infinite query caches. Uses InfiniteData to iterate over paginated data and apply mutations consistently. Introduced local queryClient variable for cleaner cache access.
Version Update
packages/sdk/package.json
Bumped package version from 1.5.16 to 1.5.17.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Caches dancing, pages aligned,
Infinite queries now perfectly twinned,
Add, edit, remove—all in step,
No orphaned fragments in memory left!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix cache invalidation' is vague and generic, using non-descriptive language that doesn't clearly convey what specific cache invalidation issues are being addressed or how they're being fixed. Clarify the title with specific details about which caches are being fixed (e.g., 'Fix infinite query cache synchronization for gallery and fragment mutations') to better communicate the changeset's purpose.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@feruzm feruzm merged commit 347ecc5 into develop Jan 26, 2026
1 check passed
@feruzm feruzm deleted the invalidate branch January 26, 2026 08:50
@coderabbitai coderabbitai Bot mentioned this pull request Feb 11, 2026
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