Skip to content

fix (desktop): superset landing page Application error due to auth cookie#692

Merged
AviPeltz merged 1 commit into
mainfrom
superset-landing-error
Jan 9, 2026
Merged

fix (desktop): superset landing page Application error due to auth cookie#692
AviPeltz merged 1 commit into
mainfrom
superset-landing-error

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Jan 9, 2026

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for session data retrieval to ensure CTA buttons display reliably, even when session fetch encounters issues.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

The CTAButtons component's session initialization now includes error handling. A try/catch block safely wraps the session fetch, defaulting session to null and logging errors on failure. Conditional rendering logic and public API signatures remain unchanged.

Changes

Cohort / File(s) Summary
Session fetch error handling
apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
Added try/catch wrapper around session fetch with null default initialization and error logging on failure (+7/-1)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested reviewers

  • CharlieHelps

Poem

A rabbit hopped through CTAButtons with glee,
Wrapped sessions in try/catch, safe as can be,
No crashes, just null and a log, oh so neat,
Error handling done—now the code's complete! 🐰✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description uses the required template structure but is largely empty. Only the 'Type of Change' section is filled (Bug fix checked); all other sections including Description, Related Issues, Testing, and Additional Notes are blank or contain only template comments. Fill in the Description section with details about the auth cookie error and the fix. Add Related Issues links if applicable. Document testing steps and reproduction instructions in the Testing section.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing an application error on the superset landing page caused by an auth cookie issue, which aligns with the code modification adding error handling for session fetches.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 9, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

@AviPeltz AviPeltz marked this pull request as ready for review January 9, 2026 18:59
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx (1)

17-53: Consider extracting the duplicated "Download for macOS" button.

The "Download for macOS" button (lines 26-32 and 45-51) is duplicated in both conditional branches. Extracting it to a constant or small component would improve maintainability and reduce the risk of inconsistent updates.

♻️ Proposed refactor to eliminate duplication
 export async function CTAButtons() {
 	let session = null;
 	try {
 		session = await auth.api.getSession({ headers: await headers() });
 	} catch (error) {
 		// Handle errors from invalid/stale cookies (e.g., old Clerk cookies after migration to Better Auth)
 		console.error("[marketing/CTAButtons] Failed to get session:", error);
 	}
+
+	const downloadButton = (
+		<a
+			href={DOWNLOAD_URL_MAC_ARM64}
+			className="px-4 py-2 text-sm font-normal bg-foreground text-background hover:bg-foreground/90 transition-colors flex items-center justify-center gap-2"
+		>
+			Download for macOS
+			<Download className="size-4" aria-hidden="true" />
+		</a>
+	);
 
 	if (session) {
 		return (
 			<>
 				<a
 					href={env.NEXT_PUBLIC_WEB_URL}
 					className="px-4 py-2 text-sm font-normal text-muted-foreground hover:text-foreground transition-colors text-center"
 				>
 					Dashboard
 				</a>
-				<a
-					href={DOWNLOAD_URL_MAC_ARM64}
-					className="px-4 py-2 text-sm font-normal bg-foreground text-background hover:bg-foreground/90 transition-colors flex items-center justify-center gap-2"
-				>
-					Download for macOS
-					<Download className="size-4" aria-hidden="true" />
-				</a>
+				{downloadButton}
 			</>
 		);
 	}
 
 	return (
 		<>
 			<a
 				href={`${env.NEXT_PUBLIC_WEB_URL}/sign-in`}
 				className="px-4 py-2 text-sm font-normal text-muted-foreground hover:text-foreground transition-colors text-center"
 			>
 				Sign In
 			</a>
-			<a
-				href={DOWNLOAD_URL_MAC_ARM64}
-				className="px-4 py-2 text-sm font-normal bg-foreground text-background hover:bg-foreground/90 transition-colors flex items-center justify-center gap-2"
-			>
-				Download for macOS
-				<Download className="size-4" aria-hidden="true" />
-			</a>
+			{downloadButton}
 		</>
 	);
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e43658 and 1ee9610.

📒 Files selected for processing (1)
  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use object parameters for functions with 2+ parameters instead of positional arguments
Functions with 2+ parameters should accept a single params object with named properties for self-documentation and extensibility
Use prefixed console logging with context pattern: [domain/operation] message
Extract magic numbers and hardcoded values to named constants at module top
Use lookup objects/maps instead of repeated if (type === ...) conditionals
Avoid using any type - maintain type safety in TypeScript code
Never swallow errors silently - at minimum log them with context
Import from concrete files directly when possible - avoid barrel file abuse that creates circular dependencies
Avoid deep nesting (4+ levels) - use early returns, extract functions, and invert conditions
Use named properties in options objects instead of boolean parameters to avoid boolean blindness

Files:

  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

One component per file - do not create multi-component files

Files:

  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Drizzle ORM for all database operations - never use raw SQL

Files:

  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome for formatting and linting - run at root level with bun run lint:fix or biome check --write

Files:

  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
🧠 Learnings (1)
📚 Learning: 2026-01-02T06:50:28.671Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-02T06:50:28.671Z
Learning: Applies to apps/*/src/components/{ui,ai-elements,react-flow}/*.tsx : Use kebab-case single files for shadcn/ui components (e.g., button.tsx, base-node.tsx) in src/components/ui/, src/components/ai-elements, and src/components/react-flow/

Applied to files:

  • apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx
🧬 Code graph analysis (1)
apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx (1)
packages/auth/src/server.ts (1)
  • auth (11-101)
🔇 Additional comments (1)
apps/marketing/src/app/components/CTAButtons/CTAButtons.tsx (1)

9-15: LGTM! Error handling properly addresses the PR objective.

The try/catch block correctly handles authentication errors from invalid or stale cookies, allowing the component to gracefully degrade to the unauthenticated state. The console logging follows the required prefixed pattern [marketing/CTAButtons] and provides useful context.

@AviPeltz AviPeltz merged commit 0a83467 into main Jan 9, 2026
13 checks passed
@Kitenite Kitenite deleted the superset-landing-error branch January 10, 2026 23:10
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