[PR #179] [CLOSED] bugfix: #170 Sign-in broken after GitHub username change #286

Closed
opened 2026-02-15 17:16:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/179
Author: @chenyuan99
Created: 2/8/2026
Status: Closed

Base: mainHead: bugfix/#170-Sign-in-broken-after-GitHub-username-change


📝 Commits (2)

  • a87e875 #170 Sign-in broken after GitHub username change
  • a093509 #170 Sign-in broken after GitHub username change

📊 Changes

1 file changed (+12 additions, -4 deletions)

View changed files

📝 convex/users.ts (+12 -4)

📄 Description

fix #170 Sign-in broken after GitHub username change

Updated user bootstrap to sync the app handle/display name with the current GitHub login on each sign-in, so username changes update the stored handle instead of leaving the old one. This keeps profile lookups and GitHub-related flows (like account age checks) aligned after a rename; change lives in convex/users.ts.

convex/users.ts: refreshes handle when user.name changes; updates displayName only when it was still the auto-generated handle.

Greptile Overview

Greptile Summary

This change updates the ensure mutation in convex/users.ts to resync a user’s stored handle with the current GitHub user.name (falling back to email prefix) on each sign-in, and to update displayName only when it’s unset or still equal to the auto-generated handle. The intent is to keep profile lookups and GitHub-dependent logic aligned after a GitHub username rename.

Main behavior change is that an existing user.handle will now be overwritten when user.name differs, instead of only being set once at bootstrap.

Confidence Score: 4/5

  • This PR is likely safe to merge after fixing a small logic inconsistency in admin role assignment.
  • The change is narrowly scoped to user bootstrap logic and appears to address the rename issue, but it introduces an inconsistency where role assignment uses the non-normalized handle while handle/displayName updates use the normalized value, which can cause incorrect role selection in edge cases.
  • convex/users.ts

(5/5) You can turn off certain types of comments like style here!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/179 **Author:** [@chenyuan99](https://github.com/chenyuan99) **Created:** 2/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `bugfix/#170-Sign-in-broken-after-GitHub-username-change` --- ### 📝 Commits (2) - [`a87e875`](https://github.com/openclaw/clawhub/commit/a87e875c9eeb084aafac416fccb5ac03f8ae01d4) #170 Sign-in broken after GitHub username change - [`a093509`](https://github.com/openclaw/clawhub/commit/a093509fb17bdf00cc196f886329fad5a4566bf5) #170 Sign-in broken after GitHub username change ### 📊 Changes **1 file changed** (+12 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `convex/users.ts` (+12 -4) </details> ### 📄 Description fix #170 Sign-in broken after GitHub username change Updated user bootstrap to sync the app handle/display name with the current GitHub login on each sign-in, so username changes update the stored handle instead of leaving the old one. This keeps profile lookups and GitHub-related flows (like account age checks) aligned after a rename; change lives in convex/users.ts. convex/users.ts: refreshes handle when user.name changes; updates displayName only when it was still the auto-generated handle. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This change updates the `ensure` mutation in `convex/users.ts` to resync a user’s stored `handle` with the current GitHub `user.name` (falling back to email prefix) on each sign-in, and to update `displayName` only when it’s unset or still equal to the auto-generated handle. The intent is to keep profile lookups and GitHub-dependent logic aligned after a GitHub username rename. Main behavior change is that an existing `user.handle` will now be overwritten when `user.name` differs, instead of only being set once at bootstrap. <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge after fixing a small logic inconsistency in admin role assignment. - The change is narrowly scoped to user bootstrap logic and appears to address the rename issue, but it introduces an inconsistency where role assignment uses the non-normalized handle while handle/displayName updates use the normalized value, which can cause incorrect role selection in edge cases. - convex/users.ts <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:40 -05:00
yindo closed this issue 2026-02-15 17:16:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#286