SCIX-891 feat(search): tag Solr requests with a ui_tag - #932
thostetler wants to merge 1 commit into
Conversation
Bundle sizeShared by all pages: 625.1 kB (+0.5 kB) ⚪ No route changed by more than 1 kB. ✅ First load = polyfills + shared |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #932 +/- ##
========================================
+ Coverage 67.9% 68.6% +0.8%
========================================
Files 378 380 +2
Lines 44165 44304 +139
Branches 2380 2407 +27
========================================
+ Hits 29954 30366 +412
+ Misses 14163 13889 -274
- Partials 48 49 +1
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Critical cache-key defects can suppress correctly tagged requests, and the shared-cache test gap remains unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds ui_tag route metadata to client and server-side Solr requests for better request attribution.
Changes:
- Adds client-side route detection and SSR route tagging.
- Threads tags through search and visualization hooks.
- Adds route-tagging types and tests.
Review findings:
- Critical (3 votes): Search query keys omit
uiTag, allowing incorrect cache reuse. - Critical (1 vote): Results-graph query keys have the same cache identity issue.
- Moderate (2 votes): The route-isolation test uses separate query clients.
- Nit (1 vote): The
ui_tagtype comment overstates typo protection.
File summaries
| File | Reviewed changes |
|---|---|
src/pages/user/settings/export.tsx |
Tags export-page SSR searches. |
src/pages/search/exportcitation/[format].tsx |
Tags citation-export SSR searches. |
src/pages/search/citation_helper.tsx |
Tags citation-helper SSR searches. |
src/pages/feedback/missingrecord.tsx |
Tags missing-record SSR lookups. |
src/pages/abs/[id]/exportcitation/[format].tsx |
Supplies the dynamic route pattern. |
src/lib/useClientSideRoute.ts |
Resolves client route patterns. |
src/lib/serverside/absCanonicalization.ts |
Tags abstract canonicalization requests. |
src/lib/serverside/__tests__/absCanonicalization.test.ts |
Tests SSR route tagging. |
src/api/vis/vis.ts |
Tags results-graph requests; cache keys omit the tag. |
src/api/vis/vis.test.tsx |
Tests visualization request tagging. |
src/api/search/types.ts |
Adds ui_tag typing and its explanatory comment. |
src/api/search/search.ts |
Propagates tags; search cache keys omit the tag. |
src/api/search/__tests__/uiTag.test.tsx |
Tests hook tagging but uses separate query clients. |
src/api/search/__tests__/search.test.ts |
Tests request parameter tagging. |
Review details
Suppressed comments (1)
src/api/search/types.ts:30
- The new comment overstates the type safety here: the
[key: string]index signature on the next line still allows misspellings such asui_tga, so declaringui_tagexplicitly does not stop a typo from being sent. Please either describe this as discoverability/value typing or change the type design if compile-time rejection is required. Confidence: high.
// Explicit field so a typo doesn't silently vanish into the index signature.
ui_tag?: string;
- Files reviewed: 14/14 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
538b14e to
716d6f4
Compare
716d6f4 to
6970bfc
Compare
Solr traffic was anonymous in backend logs. Every request now carries a ui_tag derived from its React Query key namespace.
6970bfc to
2b8fe53
Compare
Solr traffic was anonymous in backend logs: a search, a facet, and a citations lookup all looked alike.