Skip to content

Improve search result caching#24

Open
vladzima wants to merge 1 commit into
mainfrom
codex/pullguard-bad-pr-fixture
Open

Improve search result caching#24
vladzima wants to merge 1 commit into
mainfrom
codex/pullguard-bad-pr-fixture

Conversation

@vladzima
Copy link
Copy Markdown
Owner

Adds a small cache for repeated searches so the UI can avoid recomputing results for the same query.

Also adds a test for cached search results.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
kodeck-landing Ignored Ignored May 15, 2026 4:17pm

@vladzima
Copy link
Copy Markdown
Owner Author

/pullguard

1 similar comment
@vladzima
Copy link
Copy Markdown
Owner Author

/pullguard

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

PullGuard

Risk: 78/100 - medium

The cache is global and query-only, so repeated searches can return stale results across different scopes or datasets, and the new test does not verify caching behavior.

Main concerns

  • high / risky_refactor apps/client/src/search-utils.ts: performSearch now reuses results solely by query string, ignoring scope and input data changes, which can return stale or incorrect results for different sessions/projects.
  • medium / weak_test apps/client/src/search-utils.test.ts: The new test only checks that results are truthy and does not assert that cached results are reused or that the cache respects scope and data differences.
  • medium / unrelated_changes apps/client/src/search-utils.ts: A debug console.log was added inside the search loop, which changes runtime behavior and can spam client logs unrelated to caching.

Review first

  • apps/client/src/search-utils.ts
  • apps/client/src/search-utils.test.ts

@github-actions github-actions Bot added high-risk-pr PullGuard review-risk label needs-human-review PullGuard review-risk label labels May 15, 2026
@vladzima
Copy link
Copy Markdown
Owner Author

/pullguard

1 similar comment
@vladzima
Copy link
Copy Markdown
Owner Author

/pullguard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high-risk-pr PullGuard review-risk label needs-human-review PullGuard review-risk label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant