Skip to content

fix(compare): prevent comparison loading from getting stuck#8017

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
kiran-madhav:fix/compare-loading-state
Jul 15, 2026
Merged

fix(compare): prevent comparison loading from getting stuck#8017
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
kiran-madhav:fix/compare-loading-state

Conversation

@kiran-madhav

Copy link
Copy Markdown
Contributor

Description

Prevents comparison requests from leaving the Compare Developers page stuck on "Comparing...".

Fixes #8009

Changes

  • Prevents duplicate in-progress requests for the same comparison
  • Adds a 20-second timeout using AbortController
  • Resets the loading state after success, failure, or timeout
  • Displays a clear timeout error message
  • Replaces the unsupported Vercel vs Netlify organization preset with a clearly labeled founder comparison (rauchg vs biilmann)
  • Updates both the main showdown card and top rivalries ticker
  • Adds tests for timeout handling and duplicate-request prevention
  • Updates the ticker navigation test for the supported founder profiles

Testing

  • npm run format
  • npm run lint
  • npm run test
  • npm run test:coverage -- --run
  • Tested torvalds vs gvanrossum
  • Tested rauchg vs biilmann
  • Tested the main showdown card
  • Tested the top rivalries ticker

Evidence

Before

Screen recording showing the comparison remaining stuck on "Comparing...":

  • Screen.Recording.2026-07-12.163706.mp4

After

  • Successful torvalds vs gvanrossum comparison
  • Successful rauchg vs biilmann comparison
Screen.Recording.2026-07-12.163706.mp4
commitpulse-battle-rauchg-vs-biilmann commitpulse-battle-torvalds-vs-gvanrossum (1)

Copilot AI review requested due to automatic review settings July 12, 2026 19:06
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@kiran-madhav is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses a UI state bug on the Compare Developers page where comparisons could remain stuck on “Comparing…” by preventing duplicate in-flight comparisons, adding a request timeout, and ensuring the loading state is always cleared on completion.

Changes:

  • Adds in-flight request de-duplication and a 20s AbortController timeout to prevent comparisons from hanging indefinitely.
  • Ensures loading is reset after success, failure, or timeout; adds a clear timeout error message.
  • Updates the Vercel vs Netlify preset to use founder accounts and updates/extends tests to cover timeout + duplicate-request prevention.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
components/TopRivalriesTicker.tsx Switches the Vercel/Netlify rivalry to founders and adds optional display labels for ticker text.
components/TopRivalriesTicker.mouse-interactivity.test.tsx Updates ticker navigation expectations for the new founder-based preset.
components/DeveloperArena.tsx Updates the trending showdown preset to compare founders instead of org accounts.
app/compare/CompareClient.tsx Adds active-request tracking, abort timeout, and more robust loading/error cleanup to avoid “Comparing…” getting stuck.
app/compare/CompareClient.test.tsx Adds test coverage for timeout handling and preventing duplicate in-flight requests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +44
u1: 'rauchg',
u2: 'biilmann',
label: 'Vercel vs Netlify',
desc: 'Platform Wars',
desc: 'Founder Showdown',
Comment thread components/TopRivalriesTicker.tsx Outdated
Comment on lines +18 to +22
u1: 'rauchg',
u2: 'biilmann',
displayU1: 'Vercel',
displayU2: 'Netlify',
label: 'Platform Wars',
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/app/compare/page-[hash].js 15.42 KB 15.18 KB +0.24 KB (+1.56%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3911.14 KB 3910.49 KB +0.65 KB (+0.02%)
Total CSS 326.92 KB 326.92 KB 0 B

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected mentor:Aamod007 labels Jul 15, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch on the vercel vs netlify rivalry! Since those are orgs and the compare page expects users, changing it to the founders (rauchg vs biilmann) is a smart way to prevent the loading state from hanging. Approved!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jul 15, 2026
@JhaSourav07
JhaSourav07 merged commit d1d8c2a into JhaSourav07:main Jul 15, 2026
9 of 10 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @kiran-madhav! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@kiran-madhav
kiran-madhav deleted the fix/compare-loading-state branch July 15, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(compare): trending showdown remains stuck on "Comparing..."

4 participants