Repository navigation
Skip unnecessary analysis catalog queries and isolate team-scoped cache entries - #142
Conversation
Load catalog dependencies only when creating cache entries, and key name-bearing responses by the viewer’s current team. Retain the database check used by Worker invalidation. Refs: LVT-375
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🚅 Deployed to the lovat-pr-142 environment in lovat
2 services not affected by this PR
|
📱 Connect your app to this PR deploymentScan a QR code to use this PR's Server API. Worker changes use the same API; Server URL: |
Lovat AI reviewStatus: completed · Model: Reviewed commit: Critical: 0 · High: 0 · Medium: 0 · Low: 0 Overall assessmentThis PR converts import-time catalog queries into lazy, failure-tolerant snapshots and adds viewer-team isolation to the analysis cache key for the two handlers that expose scout names. The lazy loader correctly resets its snapshot on failure so a transient catalog error is not cached permanently, and the viewer-team key fragment is applied before caching so cross-team leakage via a shared cache entry is prevented. The call-site updates and test mocks are consistent with the new exported names and signatures. No concrete defect is evidenced in the changed lines. No high-confidence issues were found in the reviewed changes. Review details
Limitations
|
What changed
Load the analysis team and tournament catalogs only on demand. A warm aggregate lookup does not need to fetch the catalog or recalculate the metric. Notes and breakdown caches now include the viewer’s current team so changing teams cannot reuse a response containing names visible to the former team.
This is a first step toward Redis-only warm requests (LVT-375). It deliberately retains the PostgreSQL cache-registration check required by Worker invalidation and does not change auth or key counters.
Areas affected
Contracts and data
Verification
Node 22.20.0:
npm run build,npm run typecheck,npm run typecheck:test,npm run lint(0 errors; 79 existing warnings), andDATABASE_URL=<local unit test URL> npm run test:coverage:unit(1,462 tests passed, 100% per-file coverage). Structure and diff checks passed. Regression tests assert no catalog/compute calls on a warm aggregate and no prior-team names served after membership changes.Deployment
No configuration or migration. Only the two name-bearing analysis caches get new keys; their first request after rollout may miss.