Skip to content

refactor(chat): drop redundant useAutoLogin calls#1753

Closed
arpitgupta1214 wants to merge 1 commit into
testfrom
refactor/drop-redundant-useautologin
Closed

refactor(chat): drop redundant useAutoLogin calls#1753
arpitgupta1214 wants to merge 1 commit into
testfrom
refactor/drop-redundant-useautologin

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented May 29, 2026

useAutoLogin now fires once at the provider layer in UserProvder, so the page-level calls in CatalogsPage, CatalogSongsPage, and TasksPage are stylistically dead and removed here.

Test plan

  • Visit /catalogs, /catalogs/[id], and /tasks while signed out — Privy login modal still opens automatically

Summary by cubic

Removed redundant useAutoLogin calls from CatalogsPage, CatalogSongsPage, and TasksPage. The hook now runs once via UserProvider, so behavior is unchanged and the Privy modal still auto-opens when signed out.

Written for commit f956423. Summary will update on new commits.

Review in cubic

useAutoLogin now fires once at the provider layer in UserProvder,
so page-level calls in CatalogsPage, CatalogSongsPage, and TasksPage
are stylistically dead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview May 29, 2026 1:58am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@arpitgupta1214, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f676367-82e7-40b2-a83b-39fedc24719a

📥 Commits

Reviewing files that changed from the base of the PR and between dd2afd4 and f956423.

📒 Files selected for processing (3)
  • components/Catalog/CatalogSongsPage.tsx
  • components/Catalog/CatalogsPage.tsx
  • components/TasksPage/TasksPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/drop-redundant-useautologin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9564233fc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 5 to 6
const CatalogsPage = () => {
useAutoLogin();

return (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore auto-login for protected pages

When an unauthenticated user lands directly on /catalogs (and similarly /catalogs/[id] or /tasks), this component no longer invokes useAutoLogin(), and the claimed provider-level replacement is not present: providers/UserProvder.tsx only creates the user context, while repo-wide search leaves components/VercelChat/chat.tsx as the only remaining caller. Since useCatalogs is gated on Privy authenticated, signed-out users will just see loading skeletons instead of the login modal.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Confidence score: 3/5

  • There is a meaningful regression risk in components/Catalog/CatalogSongsPage.tsx: removing useAutoLogin() could prevent auto-login when users land directly on /catalogs while unauthenticated.
  • Given the stated move of this logic to UserProvider, this may still be correct, but the issue’s medium-high severity (7/10) and moderate confidence suggest user-facing auth flow should be validated before/at merge.
  • Pay close attention to components/Catalog/CatalogSongsPage.tsx - verify direct-entry unauthenticated visits to /catalogs still trigger auto-login through the provider path.
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="components/Catalog/CatalogSongsPage.tsx">

<violation number="1" location="components/Catalog/CatalogSongsPage.tsx:13">
P1: Removing `useAutoLogin()` here may break auto-login for unauthenticated users visiting `/catalogs` directly. The PR description states the hook now fires at the provider layer (`UserProvider`), but if that provider-level call was not actually added, signed-out users will see perpetual loading skeletons instead of the Privy login modal. Verify that `useAutoLogin()` is invoked in a shared ancestor (e.g., `UserProvider`) before shipping this removal.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

const CatalogSongsPage = ({ catalogId }: CatalogSongsPageProps) => {
useAutoLogin();
const router = useRouter();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Removing useAutoLogin() here may break auto-login for unauthenticated users visiting /catalogs directly. The PR description states the hook now fires at the provider layer (UserProvider), but if that provider-level call was not actually added, signed-out users will see perpetual loading skeletons instead of the Privy login modal. Verify that useAutoLogin() is invoked in a shared ancestor (e.g., UserProvider) before shipping this removal.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/Catalog/CatalogSongsPage.tsx, line 13:

<comment>Removing `useAutoLogin()` here may break auto-login for unauthenticated users visiting `/catalogs` directly. The PR description states the hook now fires at the provider layer (`UserProvider`), but if that provider-level call was not actually added, signed-out users will see perpetual loading skeletons instead of the Privy login modal. Verify that `useAutoLogin()` is invoked in a shared ancestor (e.g., `UserProvider`) before shipping this removal.</comment>

<file context>
@@ -10,7 +9,6 @@ interface CatalogSongsPageProps {
 const CatalogSongsPage = ({ catalogId }: CatalogSongsPageProps) => {
-  useAutoLogin();
   const router = useRouter();
 
   const handleBack = () => {
</file context>

@sweetmantech
Copy link
Copy Markdown
Collaborator

Closing — superseded by chat#1761, which merged as 36a3e140.

#1761 folded in the same removals from CatalogsPage, CatalogSongsPage, and TasksPage, plus centralized useAutoLogin into UserProvider via <UserAutoLogin /> so the hook fires once app-wide. Also collapsed LegacyAutoLogin (from #1760) and the per-mount call inside NewChatBootstrap — net effect is a single useAutoLogin call site instead of five.

Branch left intact in case anyone needs to reference the original scoping.

@sweetmantech sweetmantech deleted the refactor/drop-redundant-useautologin branch June 1, 2026 18:08
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.

2 participants