Skip to content

fix(search): clear cached content after disconnect - #7712

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/search-disconnect-cache
Sep 10, 2026
Merged

fix(search): clear cached content after disconnect#7712
icecrasher321 merged 2 commits into
stagingfrom
codex/search-disconnect-cache

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Clear cached Search results after a successful account disconnect or integration access change, and refresh server-rendered document pages.
  • Reset document and chunk caches even when a file was opened directly, cancelling pending reads that could restore old content. Document keys have no organization scope, so these resets also cause other open knowledge-base details to refetch; Search results and source lists remain organization-scoped.

Type of Change

  • Bug fix

Testing

51 focused tests passed, including success/failure after unmount, direct document and chunk caches without source lists, Search scope isolation, router refresh, and late response cancellation. App type-check, lint, all 46 repository audits, block registry, and docs manifest checks passed.

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

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 10, 2026 3:04am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously reported direct-document cache gap is resolved without introducing a new actionable defect.

Summary

  • Centralizes organization-scoped Search-result and source-list resets.
  • Clears the unscoped document/chunk detail hierarchy, including directly loaded content.
  • Refreshes Next.js server-rendered pages after cache cleanup.
  • Adds coverage for unmount behavior, failed mutations, direct cache entries, and cancellation of late responses.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Disconnect account or update integration access] --> B{Mutation succeeds?}
    B -- No --> C[Preserve existing caches and page state]
    B -- Yes --> D[Reset organization-scoped Search results]
    B -- Yes --> E[Reset organization-scoped source lists]
    B -- Yes --> F[Reset all unscoped knowledge details]
    D --> G[Cancel pending matching reads]
    E --> G
    F --> G
    G --> H[Invalidate account or integration metadata]
    H --> I[Refresh Next.js server-rendered content]
Loading

Reviews (2) · Last reviewed commit: "fix(search): reset directly opened docum..."

Comment thread apps/sim/hooks/queries/utils/reset-organization-search-access.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@icecrasher321
icecrasher321 merged commit a60acbf into staging Sep 10, 2026
34 checks passed
@icecrasher321
icecrasher321 deleted the codex/search-disconnect-cache branch September 10, 2026 03:10
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