Skip to content

Resolve profile handles case-insensitively in /u/ URLs - #29

Merged
jackwsmth merged 2 commits into
labscommunity:mainfrom
SergiioB:profile-handle-case
Sep 18, 2026
Merged

jackwsmth merged 2 commits into
labscommunity:mainfrom
SergiioB:profile-handle-case

Conversation

@SergiioB

Copy link
Copy Markdown
Contributor

Problem

Profile URLs are case-sensitive even though handles are always stored lowercase:

  • profiles_handle_format requires handle = lower(handle), and the auth sync trigger lowercases the GitHub login before upsert.
  • The profile page resolved the /u/:handle route param with exact string equality, so a URL typed or shared with GitHub's casing returned "Not found — No such user." for an account that exists.

Live repro on production: https://www.intelinside.ai/u/SergiioB 404s, while https://www.intelinside.ai/u/sergiiob renders. Every internal link is unaffected because it uses the stored lowercase handle — this only bites users who type or share their profile URL the way GitHub displays it.

Fix

In Profile.tsx, lowercase the route param before it feeds the user/rigs/results/custom-runtimes queries, and redirect mixed-case URLs to the canonical lowercase path (preserving the ?tab= query) so the address bar converges on the shareable form.

No adapter changes needed: the /u/:handle param is the only user-supplied handle in the API surface — every other caller passes handles from the session or the catalog, already lowercase.

Verification

  • npm run typecheck and npm run build pass.
  • Manually reasoned through both branches: lowercase URLs render as before (no behavior change), mixed-case URLs now resolve and canonicalize.

Handles are stored lowercase (profiles_handle_format requires
handle = lower(handle), and the auth trigger lowercases the GitHub
login), but the profile page matched the URL param with exact string
equality. Every internal link uses the stored lowercase handle, so
only a URL typed or shared with GitHub's casing breaks — and it breaks
with a bare 'No such user.' for an account that exists.

Lowercase the route param before querying and redirect mixed-case URLs
to the canonical lowercase path, preserving the tab query. No adapter
change needed: the /u/:handle param is the only user-supplied handle in
the API surface.

Repro on production: /u/SergiioB 404s while /u/sergiiob renders.
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@SergiioB is attempting to deploy a commit to the Community Labs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
No result files to import.

Site / sign up · Workflow details and retry

toAppUser built the session user's handle from GitHub auth metadata
(user_name), which keeps GitHub's original casing, while the auth
trigger stores profile handles lowercase (handle = lower(handle)).
Handles are compared with exact string equality everywhere, so the
mismatch broke two things for anyone whose GitHub login has capitals:

- TopNav "My rigs"/"My results" linked to /u/SergiioB, which the
  profile page 404s (the first report of this bug).
- The submit form filtered rigs with owner = session handle, matched
  nothing, showed "You have no rigs yet. Create the first one." and
  auto-opened the rig creator — inviting duplicate rigs on every visit.

Lowercase the handle in toAppUser, mirroring the trigger's
lower(coalesce(user_name, preferred_username, email prefix, id)).
api.me() already returned the stored profile handle; the session user
now agrees with it.
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
intelinside Ready Ready Preview Sep 18, 2026 2:58am UTC

Request Review

@jackwsmth

Copy link
Copy Markdown
Collaborator

Thanks Sergio.

After some research, it looks like this should resolve some of the issues, including people who can't submit rigs (like this commenter here).

It looks like there were some issues with some extra columns added to the database having different permissions, preventing the result for being submitted. This should be resolved now!

@jackwsmth
jackwsmth merged commit 218ffb8 into labscommunity:main Sep 18, 2026
2 of 3 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