Skip to content

Conversation

@ascpixi
Copy link
Member

@ascpixi ascpixi commented Jan 14, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

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 fixes a bug where autogenerated user handles could exceed the 16-character maximum length limit during OAuth authentication. The fix extracts the magic number into a named constant and uses it to properly truncate handles during generation.

Changes:

  • Introduced MAX_HANDLE_LENGTH constant (16) in the user schema definitions
  • Modified handle autogeneration to truncate baseHandle when it exceeds the maximum length
  • Updated suffix logic to ensure the final handle never exceeds MAX_HANDLE_LENGTH by dynamically calculating available space

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/web/src/server/routers/api/user.ts Extracted magic number 16 into MAX_HANDLE_LENGTH constant and used it in the UserHandle schema
apps/web/src/pages/api/auth-hackatime.ts Imported MAX_HANDLE_LENGTH and applied it to truncate base handles and properly size handles with numeric suffixes

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

@ascpixi ascpixi merged commit 9a8c485 into main Jan 14, 2026
5 checks passed
@ascpixi ascpixi deleted the fix/handle-autogeneration-length-limit branch January 14, 2026 01:31
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