fix: avoid duplicate mock sponsors by MoonBrillante · Pull Request #918 · TanStack/tanstack.com · GitHub
Skip to content

fix: avoid duplicate mock sponsors#918

Open
MoonBrillante wants to merge 2 commits into
TanStack:mainfrom
MoonBrillante:fix-duplicate-mock-sponsors
Open

fix: avoid duplicate mock sponsors#918
MoonBrillante wants to merge 2 commits into
TanStack:mainfrom
MoonBrillante:fix-duplicate-mock-sponsors

Conversation

@MoonBrillante

@MoonBrillante MoonBrillante commented May 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #916

This updates the GitHub sponsors fallback data used when credentials are missing.

Previously, the mock sponsor list repeated the same sponsors 20 times each, which could make the sponsor graphic look like it contained many more unique sponsors than it actually did.

The fallback now keeps the same mock sponsors but returns each one only once.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for authentication failures with deterministic fallback mock sponsor data, ensuring consistent display behavior across requests

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/utils/sponsors.functions.ts (1)

222-230: 💤 Low value

Consider extracting the mock sponsor list to a shared constant.

The same mock sponsor array is defined in both src/utils/sponsors.functions.ts and src/server/sponsors.ts. While this duplication is low-risk for fallback data, extracting it to a shared constant would improve maintainability if the list needs updating in the future.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/utils/sponsors.functions.ts` around lines 222 - 230, The mockSponsors
array is currently duplicated in two separate files. Extract this array to a
shared constant in a central utilities file or constants file that can be
imported by both locations, then update the mockSponsors definition in
sponsors.functions.ts and its duplicate in sponsors.ts to import and reference
this shared constant instead of maintaining separate copies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/utils/sponsors.functions.ts`:
- Around line 222-230: The mockSponsors array is currently duplicated in two
separate files. Extract this array to a shared constant in a central utilities
file or constants file that can be imported by both locations, then update the
mockSponsors definition in sponsors.functions.ts and its duplicate in
sponsors.ts to import and reference this shared constant instead of maintaining
separate copies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f57a377f-cbba-415b-9b7f-81a740a2e1d8

📥 Commits

Reviewing files that changed from the base of the PR and between 13f4d55 and 417b63c.

📒 Files selected for processing (2)
  • src/server/sponsors.ts
  • src/utils/sponsors.functions.ts

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.

Duplicate sponsors

1 participant