Skip to content

docs: document query cancellation semantics#1692

Closed
ColumbusLabs wants to merge 1 commit into
TanStack:mainfrom
ColumbusLabs:codex/query-cancellation-docs
Closed

docs: document query cancellation semantics#1692
ColumbusLabs wants to merge 1 commit into
TanStack:mainfrom
ColumbusLabs:codex/query-cancellation-docs

Conversation

@ColumbusLabs

@ColumbusLabs ColumbusLabs commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

Closes #350

✅ Checklist

  • I have tested this code locally with pnpm test.

Additional verification:

  • pnpm test:docs
  • pnpm exec prettier --check docs/collections/query-collection.md
  • pnpm lint
  • pnpm test:sherif
  • pnpm build
  • pnpm --filter @tanstack/query-db-collection test

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation
    • Added guidance for making collection requests cancellable using QueryFunctionContext.signal.
    • Documented how collection cleanup affects in-flight requests and when underlying requests are aborted.
    • Clarified the difference between eager cleanup and on-demand subset unloading, including cache reuse behavior.
    • Added references to planned cancellation and lease-policy improvements.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1712cf6e-3225-4dce-8e7a-df799da03d71

📥 Commits

Reviewing files that changed from the base of the PR and between d70fb2a and 816df3e.

📒 Files selected for processing (1)
  • docs/collections/query-collection.md

📝 Walkthrough

Walkthrough

Adds documentation for forwarding QueryFunctionContext.signal to abortable request clients, cleanup-triggered cancellation, and on-demand subset unloading behavior.

Changes

Query cancellation documentation

Layer / File(s) Summary
Signal cancellation semantics
docs/collections/query-collection.md
Documents QueryFunctionContext.signal, collection.cleanup() cancellation behavior, client signal consumption requirements, subset unloading semantics, and related RFC/PR references.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: kyleamathews, kevin-dp

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the docs-only change about query cancellation semantics.
Description check ✅ Passed The description follows the template and includes changes, checklist, and release impact sections.
Linked Issues check ✅ Passed The docs cover all required issue #350 points, including signal usage, cleanup cancellation, subset unload behavior, and RFC/PR references.
Out of Scope Changes check ✅ Passed The PR appears scoped to documentation only and adds no unrelated runtime or API changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ColumbusLabs

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1694, which corrects the cancellation semantics and expands the documentation coverage. Thanks for carrying this forward.

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.

Document QueryFunctionContext signal and cancellation semantics

1 participant