Skip to content

Fix Badge Loading Issue by Resetting Generation Key - #8730

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
sureshsuriya:fix/5694-regenerate-badge-loading
Aug 6, 2026
Merged

Fix Badge Loading Issue by Resetting Generation Key#8730
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
sureshsuriya:fix/5694-regenerate-badge-loading

Conversation

@sureshsuriya

Copy link
Copy Markdown
Contributor

Description

Fixes #5694

This PR fixes an issue where clicking "Generate Badge" multiple times with the same GitHub username caused the badge to remain in an infinite loading/suspended state.

Changes

  • Added a generationKey state to force a fresh badge request on every generation.
  • Removed the restriction preventing regeneration for the same username.
  • Reset the loading state before each badge generation.
  • Appended a cache-busting t query parameter to the badge URL so the browser always fetches a fresh image.
  • Added a regression test to verify repeated badge generation works correctly and the loading state resolves after each request.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

N/A (Bug fix only)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have updated README.md if I added a new theme or URL parameter. (Not applicable)
  • I have starred the repo.
  • I have made sure that I have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse quality standards.
  • (Recommended) I joined the CommitPulse Discord community.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

This pull request resolves an issue with badge generation that could lead to an infinite loading state when the same username is used multiple times. The changes include resetting the generation key and appending a cache-busting parameter to ensure fresh badge requests. This approach is similar to past decisions made to enforce uniqueness in selections, which aimed to prevent duplicate entries and improve user experience. Thank you for your contribution!

@retenta-bot retenta-bot Bot changed the title fix(badge): reset generationKey to re-trigger badge loading on repeat generation (#5694) Fix Badge Loading Issue by Resetting Generation Key Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4939.33 KB 4939.27 KB +0.06 KB (+0.00%)
Total CSS 348.46 KB 348.46 KB 0 B

@Aamod007 Aamod007 added level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected mentor:Aamod007 labels Aug 6, 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.

Thank you for fixing the infinite loading issue with the badge! Adding the \generationKey\ and using it as a cache-busting \ \ parameter in \�pp/components/LandingPageClient.tsx\ is a very clever way to ensure the browser fetches a fresh image. The addition of the regression test in \�pp/page.test.tsx\ also gives us great confidence in this fix. Looks fantastic!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Aug 6, 2026
@JhaSourav07
JhaSourav07 merged commit 2ac03fe into JhaSourav07:main Aug 6, 2026
10 of 11 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Aug 6, 2026
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:intermediate Moderate complexity tasks 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: Re Generate badge leads to suspended loading state

3 participants