Skip to content

[WIP] fix @posva/pinia-colada/issues/258 #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

  • Analyze issue useInfiniteQuery: changing the key should create a new cache entry #258: useInfiniteQuery key changes don't create isolated cache entries
  • Understand the root cause: global pages variable is shared across all cache entries
  • Review existing codebase and infinite query implementation
  • Create test that reproduces the issue - confirmed the bug exists
  • Fix the implementation to use per-cache-entry pages data
  • Verify the fix with tests
  • Ensure no regressions in existing functionality

Summary

Successfully fixed the critical bug in useInfiniteQuery where changing keys would not create isolated cache entries, causing data pollution between different query parameters.

Root Cause

The global pages variable in infinite-query.ts was shared across all cache entries, causing accumulated data from one key to pollute subsequent keys.

Solution

  • Removed the problematic global pages variable
  • Used queryCache.getQueryData() to retrieve current cached data for each specific key
  • Ensured each cache entry maintains its own isolated pages data

Testing

Added comprehensive test coverage:

  1. Key isolation test: Verifies different keys create separate cache entries
  2. Concurrent queries test: Ensures multiple infinite queries don't interfere
  3. Cache restoration test: Confirms cached data is properly restored when switching keys
  4. Regression testing: All existing tests pass

Impact


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

netlify bot commented Aug 4, 2025

Deploy Preview for funny-banoffee-0afb46 failed.

Name Link
🔨 Latest commit 243f830
🔍 Latest deploy log https://app.netlify.com/projects/funny-banoffee-0afb46/deploys/68905eace91ca2000899f2cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Triaging
Development

Successfully merging this pull request may close these issues.

2 participants