Skip to content

fix: profile saves leave stale sidebar identity - #120791

Merged
shakkernerd merged 9 commits into
mainfrom
aiden/fix-profile-identity-sync
Aug 9, 2026
Merged

shakkernerd merged 9 commits into
mainfrom
aiden/fix-profile-identity-sync

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #120784

Note

AI-assisted change. The implementation and focused proof were reviewed locally before submission.

What Problem This Solves

Fixes an issue where users changing their Control UI display name or avatar could continue seeing the old identity in the bottom-left sidebar. Avatar updates could also briefly flash the previous cached image.

Why This Change Was Made

Profile saves now refresh the authenticated profile attached to every matching live connection, update its presence entry with a revisioned avatar URL, and broadcast one fresh presence snapshot. The refresh is limited to connections for the changed profile; it does not change the gateway protocol or persisted profile schema.

User Impact

After saving a new name or avatar, users immediately see the new identity in the sidebar without reloading and without falling back to the stale cached avatar.

Evidence

Motion proof

Profile identity updates live in the sidebar

The recording starts with Test Person in the bottom-left sidebar and shows it updating in place to Updated Person after the presence refresh.

Before / after stills

Before After
Sidebar before profile refresh Sidebar after profile refresh
Old sidebar identity: Test Person Refreshed sidebar identity: Updated Person

Validation logs

PASS focused gateway + UI unit suite
  8 files passed
  446 tests passed

PASS profile page UI E2E proof
  1 file passed
  4 tests passed
  Captured GIF/video plus before/after screenshots

BLOCKED full core/core-test TypeScript checks
  Current-main failures are outside changed files (terminal/fs-bridge API mismatch)
PASS pnpm ui:build
PASS oxfmt --check (changed files)
PASS git diff --check
PASS TruffleHog secret scan
PASS autoreview — no accepted/actionable findings

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@Solvely-Colin
Solvely-Colin force-pushed the aiden/fix-profile-identity-sync branch from 7e6953a to e1d1f43 Compare August 9, 2026 00:33
@Solvely-Colin
Solvely-Colin marked this pull request as ready for review August 9, 2026 00:33
Copilot AI lite review requested due to automatic review settings August 9, 2026 00:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Control UI bug where saving a user profile (display name/avatar) could leave the sidebar showing stale identity data, by refreshing live connection metadata and broadcasting an updated presence snapshot.

Changes:

  • Add a gateway request-context hook to refresh matching connected clients’ authenticated profile metadata and upsert/broadcast presence.
  • Call that refresh hook after successful users.setDisplayName and users.setAvatar mutations.
  • Extend regression coverage with gateway unit tests and a UI E2E assertion that the sidebar identity updates live.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/src/e2e/profile-page.e2e.test.ts Updates E2E expectations to assert the sidebar name/initials reflect the refreshed presence identity.
src/gateway/server-request-context.ts Adds refreshConnectedUserProfile to update live client auth profile state and broadcast a new presence snapshot.
src/gateway/server-request-context.test.ts Adds unit coverage for refreshing multiple connections and removing avatar URLs when avatars are removed.
src/gateway/server-methods/users.ts Invokes the new refresh hook after successful display name and avatar mutations.
src/gateway/server-methods/users.test.ts Adjusts handler harness to pass context and asserts the refresh hook is called after mutations.
src/gateway/server-methods/shared-types.ts Extends shared gateway types with presenceKey and the new refreshConnectedUserProfile context method.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/gateway/server-request-context.ts Resolved
Comment thread src/gateway/server-request-context.ts Resolved
Comment thread ui/src/e2e/profile-page.e2e.test.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1d1f43cca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/server-request-context.ts Resolved
Comment thread src/gateway/server-request-context.ts Resolved
Comment thread src/gateway/server-request-context.ts Resolved
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 12:50 AM ET / 04:50 UTC.

ClawSweeper review

What this changes

Refreshes live authenticated gateway connections and presence snapshots after a profile name or avatar save so the Control UI sidebar updates without reload.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

The PR is the correct active repair for the linked sidebar-identity bug: current main retains connection-time profile data after a save, while this branch refreshes the live owner and presence projection. No patch defect remains, but protected maintainer handling and failed exact-head CI require human review before merge.

Priority: P2
Reviewed head: d7ffc7096d764aabb86dce8ffd9c5cff68753407
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with visible UI proof and broad regression coverage; only exact-head CI and maintainer review remain.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
Evidence reviewed 6 items Current-main stale lifecycle: Current main persists profile mutations but does not refresh the live connection snapshot later used to project presence, leaving a saved identity stale until reconnect.
Owner-boundary repair: The branch resolves canonical profile display data after each mutation, updates matching live clients and presence rows, then broadcasts one refreshed snapshot.
Shared projection preserves contracts: The shared authenticated-presence projection retains Tailscale email suppression, the avatar route for profiles without uploads, and canonical avatar revisions; focused regression coverage exercises each case.
Findings None None.
Security None None.

How this fits together

Control UI profile saves call gateway user methods that persist profile data, while gateway presence snapshots feed the sidebar identity card. The PR connects those paths by refreshing the live connection projection after a successful save.

flowchart LR
A[Profile settings save] --> B[Gateway user method]
B --> C[Profile display data]
C --> D[Live gateway connections]
D --> E[Presence snapshot]
E --> F[Control UI sidebar]
Loading

Decision needed

Question Recommendation
Can the assigned gateway/UI reviewer confirm the failed exact-head CI cause, refresh the branch if needed, and approve this owner-boundary repair once required checks are green? Refresh CI and approve: Resolve or attribute the two failed checks on the current head, refresh against main if needed, then approve the focused repair.

Why: The patch is correct, but this PR carries a maintainer label and required CI has not reached a clean terminal state.

Before merge

  • Resolve merge risk (P1) - The supplied exact-head status has failures in checks-node-compact-small-5 and openclaw/ci-gate; their underlying cause was not available in this read-only review, so merge needs green exact-head CI or maintainer-confirmed unrelated attribution.
  • Resolve merge risk (P1) - The PR is behind main and should receive a merge/review refresh before landing.
  • Complete next step (P2) - The remaining work is protected maintainer review and exact-head CI confirmation, not an automated repair task.
Agent review details

Security

None.

PR surface

Source +80, Tests +270. Total +350 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 117 37 +80
Tests 3 276 6 +270
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 393 43 +350

Review metrics

Metric Value Why it matters
Production and test delta production +117/-37 (net +80); tests +276/-6 (net +270) The production growth is justified by a new owner-boundary refresh path and shared canonical projection; the larger test delta covers matching clients, privacy, avatar revisions, and the visible UI result.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #120784
Summary: This PR is the explicit candidate fix for the open sidebar identity report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared authenticated-presence projection, land it only after exact-head CI and assigned maintainer review are complete, then let the linked issue close through the merged fix.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the shared authenticated-presence projection, land it only after exact-head CI and assigned maintainer review are complete, then let the linked issue close through the merged fix.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: profile mutations update durable state while the connection-time presence projection remains unchanged until reconnect. The PR adds focused gateway and browser regression coverage for that path.

Is this the best way to solve the issue?

Yes. Refreshing the gateway-owned live connection and presence state is preferable to retaining stale backend facts and compensating only in the Control UI.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 34062ead2047.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
  • remove proof: 🎥 video: Current real behavior proof evidence kind is screenshot.

Label justifications:

  • P2: This repairs a bounded but user-visible Control UI identity inconsistency after a successful profile save.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
  • proof: sufficient: Contributor real behavior proof is sufficient. Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Prepared before/after screenshots directly show the sidebar’s identity changing after the tested profile-refresh flow; no private values are visible.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the connection-time profile snapshot and related profile feature work to this commit. (role: feature introducer and recent gateway-profile contributor; confidence: high; commits: 5cf9c9cda6cc; files: src/gateway/server-methods/users.ts, src/gateway/server/ws-connection/connect-session.ts, src/state/user-profiles.ts)
  • shakkernerd: The PR timeline records an assignment during this review cycle. (role: assigned reviewer; confidence: medium; files: src/gateway/server-request-context.ts, ui/src/e2e/profile-page.e2e.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve or confirm the cause of the two failed exact-head checks, then refresh required CI before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-09T01:41:39.549Z sha e1d1f43 :: found issues before merge. :: [P2] Preserve the avatar route for profiles without an upload | [P2] Keep Tailscale provider logins out of presence | [P2] Use the hash avatar revision for refreshed presence | [P3] Use a retrying assertion for the sidebar name
  • reviewed 2026-08-09T02:38:26.906Z sha 1e4fd73 :: needs maintainer review before merge. :: none

@Solvely-Colin
Solvely-Colin requested a review from a team as a code owner August 9, 2026 02:00
@Solvely-Colin
Solvely-Colin force-pushed the aiden/fix-profile-identity-sync branch from 0b453e0 to faf2572 Compare August 9, 2026 02:08
@Solvely-Colin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 9, 2026
@shakkernerd shakkernerd self-assigned this Aug 9, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 9, 2026
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed proof: 🎥 video Contributor real behavior proof includes video or recording evidence. labels Aug 9, 2026
@shakkernerd
shakkernerd force-pushed the aiden/fix-profile-identity-sync branch from d7ffc70 to a7055e7 Compare August 9, 2026 10:16
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 9, 2026
@shakkernerd
shakkernerd force-pushed the aiden/fix-profile-identity-sync branch from a7055e7 to 20fb9ea Compare August 9, 2026 10:43
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 9, 2026
@shakkernerd
shakkernerd merged commit c44b016 into main Aug 9, 2026
125 checks passed
@shakkernerd
shakkernerd deleted the aiden/fix-profile-identity-sync branch August 9, 2026 10:58
@shakkernerd

Copy link
Copy Markdown
Contributor

Merged using squash.

What changed after review:

  • Returned canonical avatar revisions through profile mutation responses and live presence.
  • Preserved merged-profile and response/event ordering across connected browsers without reconnect.
  • Added focused deterministic and live coverage, consolidated duplicate tests, and refreshed the Plugin SDK API baseline.

Verification:

  • Rebased/refreshed onto current origin/main before merging.
  • Blacksmith Testbox: protocol, Gateway, ProfilePage, Chromium E2E, path-scoped guards, build, consolidated tests, and generated baseline checks passed.
  • OCM live proof: direct AWS run run_6af96e64ee07 passed profile merge, response-first and presence-first uploads, equal timestamps, distinct hashes, and Chromium/Firefox convergence.
  • Auto-review: clean; independent Workloop review found no blocking defect.
  • GitHub checks: exact head 20fb9ea completed with 85 passing checks, 27 skipped, and zero failures or pending checks.

Landed on main:

Thanks @Solvely-Colin!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
Profile identity changes now refresh immediately across connected browsers, including revisioned avatar URLs that avoid stale cached images.

Fixes openclaw#120784
Prepared head SHA: 20fb9ea
Co-authored-by: Colin Johnson <[email protected]>
Co-authored-by: Shakker <[email protected]>
Reviewed-by: @shakkernerd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI profile save can leave stale sidebar identity

3 participants