Skip to content

Fix Awaiting of setAlertConfig in CI/CD Alerts Route - #9011

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:fix/missing-await-cicd-alerts
Aug 13, 2026
Merged

Fix Awaiting of setAlertConfig in CI/CD Alerts Route#9011
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:fix/missing-await-cicd-alerts

Conversation

@tamilr0727-ux

Copy link
Copy Markdown
Contributor

Description

Fixes the POST handler in app/api/cicd/alerts/route.ts by awaiting the asynchronous setAlertConfig() operation before returning the API response.

Changes

  • Added await to thesetAlertConfig()call.
  • Ensured the API response is returned only after the alert configuration has been successfully persisted.
  • Ensured failures from Redis/cache writes are caught by the route's existing error-handling logic.
  • Prevented unhandled promise rejections from background setAlertConfig() calls.
  • Added regression tests covering successful and failed configuration updates.

Verification

vitest run passes successfully.
✅ Alert configuration writes are awaited.
✅ Persistence failures are correctly propagated to the API error handler.
✅ No unhandled promise rejections occur from setAlertConfig().

Fixes #9009

Pillar

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

Visual Preview

Can Check in the Files Changed Section.

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 (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@tamilr0727-ux 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 12, 2026

Copy link
Copy Markdown

This pull request addresses an important issue by ensuring that the alert configuration is properly awaited, preventing potential unhandled promise rejections. It also includes regression tests to cover both successful and failed updates, which aligns with our previous decisions to enhance error resilience and exception handling in API routes. Thank you for your contribution, and I look forward to your updates!

@retenta-bot retenta-bot Bot changed the title fix: await setAlertConfig in cicd alerts route Fix Awaiting of setAlertConfig in CI/CD Alerts Route Aug 12, 2026
@github-actions

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 4998.89 KB 4998.89 KB 0 B
Total CSS 354.18 KB 354.18 KB 0 B

@JhaSourav07
JhaSourav07 merged commit b42ac21 into JhaSourav07:main Aug 13, 2026
7 of 8 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @tamilr0727-ux! 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! 💻✨

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points type:bug Something isn't working as expected labels Aug 13, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Aug 13, 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 GSSoC 2026 level:intermediate Moderate complexity tasks quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: unhandled promise due to missing await in cicd/alerts route

2 participants