Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review Summary
Change Summary
Three changes bundled in this PR:
Feed/Home dedup (
page.tsxx2): Both the home page and/feedpage now fetch 6 trending papers instead of 3, filter out any that already appear in the user's main feed, then slice back to 3. This prevents duplicate paper cards showing in both the feed and trending sidebar.Groups sidebar on /feed (
feed/page.tsx): Adds a "Your circles" section showing up to 2 groups in the feed sidebar, fetched vialistGroups.ORCID profile linking (
auth/index.ts): Adds adatabaseHookon account creation that writes the ORCID ID to the user's profile row when they link an ORCID account.Validation Confidence: Medium
Setlookup + filter + slice.as nevercasts in the auth hook suggest a Drizzle type mismatch (profiles table shape vs. whatupdate/whereexpects). It works at runtime but masks type errors.Risks
as nevercastsprofilesschema changes, the cast silences the compiler — a real column rename or type change would only surface at runtime.db.updatein theafterhook throws (e.g. no matching profile row), it's unclear whetherbetterAuthswallows or propagates the error. An unhandled throw could fail the entire account-creation flow.groups.length > 0, which is fine, but theGroupCardimport is untested in this page context.Recommendation
The dedup logic itself is clean. Consider:
db.updatein a try/catch with logging so a profile-write failure doesn't break account creation.as neverwith proper typing or a targeted// @ts-expect-errorwith an explanation.