Conversation
Contributor
Author
Contributor
|
@xgraceyan I have started the AI code review. It will take a few minutes to complete. |
Contributor
There was a problem hiding this comment.
4 issues found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/antalmanac/src/components/Header/Save.tsx">
<violation number="1" location="apps/antalmanac/src/components/Header/Save.tsx:27">
P2: Analytics event `CLICK_SAVE` will also fire when the user **closes** the sign-in dialog, since `handleClickSignIn` is reused as the `onClose` handler for `SignInDialog` (line 130). This will produce misleading analytics data. Consider either splitting the handler into separate open/close functions, or gating the log on the current dialog state (e.g., only log when `openSignInDialog` is `false`, meaning the dialog is about to open).</violation>
</file>
<file name="apps/antalmanac/src/components/Header/Signout.tsx">
<violation number="1" location="apps/antalmanac/src/components/Header/Signout.tsx:50">
P1: The `logAnalytics` call for `SIGN_OUT` is placed **after** `window.location.href = logoutUrl`, so when a logout URL is present, the browser navigates away before PostHog can flush the event. This means the sign-out event will never actually be recorded.
Move the `logAnalytics` call (and potentially `postHog?.reset()`) **before** the redirect to ensure the event is captured.</violation>
</file>
<file name="apps/antalmanac/src/components/Header/Signin.tsx">
<violation number="1" location="apps/antalmanac/src/components/Header/Signin.tsx:115">
P2: Redundant `analyticsIdentifyUser` call may overwrite correct OAuth identity with a stale guest user ID. `loadScheduleWithSessionToken` already identifies the user internally using the real user ID from the backend. This second call uses `userID` from the function parameter (sourced from `savedUserID` in localStorage), which could be a legacy guest ID — causing PostHog to misidentify an OAuth user.
Remove this line since identification is already handled inside `loadScheduleWithSessionToken`.</violation>
</file>
<file name="apps/antalmanac/src/components/Header/Import.tsx">
<violation number="1" location="apps/antalmanac/src/components/Header/Import.tsx:166">
P2: The `term` parameter is immediately shadowed by `const term = RightPaneStore.getFormData().term;` inside the function body, making this parameter dead code. The value passed by callers is silently ignored. Either remove the parameter and its corresponding arguments from all call sites, or remove the inner `const term` declaration to use the passed-in value.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
Author
Contributor
|
@xgraceyan I have started the AI code review. It will take a few minutes to complete. |
Collaborator
|
Collaborator
|
/deploy |
Member
|
What's going on over here 👅 |
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.
Summary
Posthog analytics for AANTS. Based off PostHog Auth which should be merged first
Test Plan
Try the actions listed here and see if Posthog logs them accordingly with the correct properties.
Issues
Closes #