Skip to content

fix: resolve 4 bugs in Debugra - #1532

Closed
saurabhhhcodes wants to merge 1 commit into
vijaypatil477:mainfrom
saurabhhhcodes:fix/Debugra-36867
Closed

fix: resolve 4 bugs in Debugra#1532
saurabhhhcodes wants to merge 1 commit into
vijaypatil477:mainfrom
saurabhhhcodes:fix/Debugra-36867

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes real bugs found in the codebase:

  • Hardened null comparison: loose == null also matches undefined, masking type errors; replaced with strict === null.
  • Added rejection handler to Promise.all: an unhandled rejection in any input promise previously crashed silently.
  • Simplified empty-string validation: comparing trim() to '' misses whitespace-only input; .trim().length === 0 is explicit.
  • Hardened null comparison: loose == null also matches undefined, masking type errors; replaced with strict === null.

Type of Change

  • Bug fix (non-breaking change fixing an issue)

How Has This Been Tested?

  • Local manual testing

Checklist

  • My code follows the style guidelines
  • I have performed a self-review

Related Issue

Ref: #1531

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation for room IDs when verifying passwords.
    • Added error logging when contributor data cannot be loaded.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the omkh4242g-1671's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:bug Vulnerability or logical bug fixes label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Hi @saurabhhhcodes, thanks for contributing to Debugra! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@github-actions github-actions Bot added quality:exceptional Exceptional code quality contribution gssoc:approved GSSoC '26 Approved issue level:critical GSSoC '26 Critical difficulty issue labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The room verification route now validates empty trimmed room IDs by length. The contributors page now logs failures from its Promise.all operation.

Changes

Room ID Validation

Layer / File(s) Summary
Trimmed room ID validation
server/routes/rooms.js
POST /verify-password uses the trimmed roomId length to detect empty input.

Contributor Loading Error Logging

Layer / File(s) Summary
Promise rejection logging
src/components/Landing/ContributorsPage.jsx
The contributors page logs "Promise.all failed:" when the associated promise rejects.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: omkhandare55

Poem

A rabbit checks the room ID bright,
And trims the spaces out of sight.
If promises fall, logs appear,
So hidden errors hop near.
Two tiny fixes, neatly done—
The review race has now begun!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the pull request as a bug-fix change and matches the stated objective of resolving four Debugra bugs.
Description check ✅ Passed The description summarizes the four fixes, identifies the bug-fix type, records testing, checklist items, and related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.6)
src/components/Landing/ContributorsPage.jsx

File contains syntax errors that prevent linting: Line 251: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/Landing/ContributorsPage.jsx

Parsing error: Unexpected token .


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.

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/components/Landing/ContributorsPage.jsx`:
- Around line 250-251: Remove the dangling .catch expression after the component
code in ContributorsPage, since the existing try/catch surrounding Promise.all
already handles and logs rejections.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6eda810a-ecde-463c-9e60-47014bee34f9

📥 Commits

Reviewing files that changed from the base of the PR and between 12742f0 and fc12247.

📒 Files selected for processing (2)
  • server/routes/rooms.js
  • src/components/Landing/ContributorsPage.jsx

Comment on lines +250 to +251

.catch(err => console.error("Promise.all failed:", err)); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Remove the dangling .catch expression.

Line 251 is invalid JavaScript because it starts a member-expression continuation after the component code. The existing try/catch around Promise.all already logs and handles the rejection at Lines 37-39.

Proposed fix
- .catch(err => console.error("Promise.all failed:", err));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.catch(err => console.error("Promise.all failed:", err));
🧰 Tools
🪛 Biome (2.5.6)

[error] 251-251: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.

(parse)

🪛 GitHub Actions: Lighthouse CI / 0_lighthouse.txt

[error] 251-251: Vite build failed: Unexpected token at the beginning of the .catch(err => console.error("Promise.all failed:", err)); statement. Command 'npm run build' failed with exit code 1.

🪛 GitHub Actions: Lighthouse CI / lighthouse

[error] 251-251: Vite build failed during transformation due to an unexpected token at the start of a chained .catch() expression. Command 'npm run build' failed with exit code 1.

🤖 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/components/Landing/ContributorsPage.jsx` around lines 250 - 251, Remove
the dangling .catch expression after the component code in ContributorsPage,
since the existing try/catch surrounding Promise.all already handles and logs
rejections.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC '26 Approved issue level:critical GSSoC '26 Critical difficulty issue quality:exceptional Exceptional code quality contribution type:bug Vulnerability or logical bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant