Skip to content

feature request: QQ ID autofill at registry#1072

Merged
undefined-moe merged 4 commits into
hydro-dev:masterfrom
035966-L3:master
Nov 7, 2025
Merged

feature request: QQ ID autofill at registry#1072
undefined-moe merged 4 commits into
hydro-dev:masterfrom
035966-L3:master

Conversation

@035966-L3

@035966-L3 035966-L3 commented Oct 29, 2025

Copy link
Copy Markdown

Summary by CodeRabbit

  • Improvements
    • Registration for QQ email addresses now automatically extracts and stores the user's QQ ID and sets the profile avatar to the corresponding QQ avatar format, improving profile completeness and display for accounts created with QQ emails.

@coderabbitai

coderabbitai Bot commented Oct 29, 2025

Copy link
Copy Markdown

Walkthrough

The change modifies the user registration handler to extend QQ email domain processing. When a user registers with a QQ email address (domain qq.com) whose local part is entirely numeric, the handler now sets the user's avatar to qq:<id> and also stores the numeric ID in a new qq field on the user document. No other control flow, error handling, or public signatures were changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-file modification in one handler method
  • Simple additional field assignment with no control flow changes
  • No public API or signature alterations
  • Focus review on correct field naming and any surrounding validations/configuration

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feature request: QQ ID autofill at registry' clearly and specifically describes the main change in the changeset. The code modification adds QQ ID autofill functionality during user registration when a qq.com email with a numeric local part is detected, which aligns directly with the title's description of QQ ID autofilling at the registry (user registration).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf81ca7 and e321b84.

📒 Files selected for processing (1)
  • packages/hydrooj/src/handler/user.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/hydrooj/src/handler/user.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build

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 and usage tips.

@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: 0

🧹 Nitpick comments (1)
packages/hydrooj/src/handler/user.ts (1)

315-318: Use a more robust numeric check for QQ IDs.

The condition !Number.isNaN(+id) will incorrectly accept edge cases like empty strings (converts to 0), whitespace, decimal numbers like "123.45", and scientific notation like "1e5". For QQ IDs, which should be pure numeric strings, use a regex pattern instead.

Apply this diff to use a more precise check:

-        if (mailDomain === 'qq.com' && !Number.isNaN(+id)) {
+        if (mailDomain === 'qq.com' && /^\d+$/.test(id)) {
             $set.avatar = `qq:${id}`;
-            $set.qq = `${id}`;
+            $set.qq = id;

Note: Also removed the redundant template literal on line 317 since id is already a string.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15c58e0 and bf81ca7.

📒 Files selected for processing (1)
  • packages/hydrooj/src/handler/user.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build

@035966-L3

Copy link
Copy Markdown
Author

@coderabbitai generate docstrings

@coderabbitai

coderabbitai Bot commented Oct 29, 2025

Copy link
Copy Markdown
✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai

coderabbitai Bot commented Oct 29, 2025

Copy link
Copy Markdown

Caution

Docstrings generation - FAILED

No docstrings were generated.

@undefined-moe undefined-moe merged commit cc41353 into hydro-dev:master Nov 7, 2025
7 of 8 checks passed
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.

2 participants