Skip to content

Fix the entire codebase 🇫🇮#17

Merged
alexechoi merged 9 commits into
mainfrom
alex/fixes
Nov 15, 2025
Merged

Fix the entire codebase 🇫🇮#17
alexechoi merged 9 commits into
mainfrom
alex/fixes

Conversation

@alexechoi

@alexechoi alexechoi commented Nov 15, 2025

Copy link
Copy Markdown
Owner

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 cache collection 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
Order File Path
1 junction-app/app/auth/page.tsx
2 junction-app/app/api/research/route.ts
3 junction-app/app/dashboard/page.tsx
⚠️ Inconsistent Changes Detected
File Path Warning
junction-app/app/auth/page.tsx A complete UI redesign of the authentication page seems unrelated to fixing caching/report lookup logic described in the other files

Need help? Join our Discord

@vercel

vercel Bot commented Nov 15, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
aegis Ready Ready Preview Comment Nov 15, 2025 9:43pm

@recurseml recurseml Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 949a33d..0d9ce39

  Severity     Location     Issue     Delete  
High 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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@alexechoi alexechoi merged commit a5dfd15 into main Nov 15, 2025
4 checks passed
@alexechoi alexechoi deleted the alex/fixes branch November 15, 2025 21:43
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