Fix the entire codebase 🇫🇮#17
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 949a33d..0d9ce39
| Severity | Location | Issue | Delete |
|---|---|---|---|
| junction-app/app/api/research/route.ts:109 | Runtime TypeError on non-strings |
✅ Files analyzed, no issues (2)
• junction-app/app/auth/page.tsx
• junction-app/app/dashboard/page.tsx
| matchedEntity.name, | ||
| ] | ||
| .filter(Boolean) | ||
| .map((value: string) => value.toLowerCase()); |
There was a problem hiding this comment.
Runtime TypeError when non-string values are processed. The code filters possibleCacheIds from matchedEntity properties (cacheId, cache_id, id, name, etc.) using .filter(Boolean), which only removes falsy values but does NOT guarantee the remaining values are strings. Since matchedEntity is typed as Record<string, any> and populated from untyped Firestore data, these fields could be numbers, objects, arrays, or other non-string types. The type annotation (value: string) is merely a type assertion and does not perform runtime validation. When .toLowerCase() is called on a non-string value, it will throw: TypeError: value.toLowerCase is not a function. This will crash the API endpoint when triggered by Firestore data containing non-string cache ID fields. To fix, convert values to strings before calling toLowerCase(): .map((value) => String(value).toLowerCase())
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
Fix the entire codebase 🇫🇮
High-level PR Summary
This PR implements a caching layer for entity research reports and redesigns the authentication page with a modern UI. The research API now checks a
cachecollection before querying entities, attempting multiple cache ID variations to locate cached reports. The dashboard redirects to/reports/{reportId}instead of/entity/{id}when cached data is found. The auth page receives a complete visual overhaul with a dark theme, gradient effects, stats display, and improved form design while maintaining the same functionality.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
junction-app/app/auth/page.tsxjunction-app/app/api/research/route.tsjunction-app/app/dashboard/page.tsxjunction-app/app/auth/page.tsx