Skip to content

fix(profile): avatar cannot be cleared, PII is console-logged, and the read-only email is editable #591

Closed

Description

@thinkclay

Three defects in the General Information form, small individually, all on the primary profile editor.

1. Clearing the avatar cannot be saved

packages/scf-core/features/profile/profile-general-left.tsx:240

} else {
  setValue("avatar_path", "")   // no { shouldDirty: true }
}

RHF's setValue defaults to shouldDirty: false, so isDirty stays false and the Save button remains disabled (:415). There is no other path that clears an avatar — a user who uploads one can never remove it.

2. The form logs the user's PII to the console on every keystroke

packages/scf-core/features/profile/profile-general-left.tsx:153 and :165

useEffect(() => { console.log("📊 Form state updated:", { isDirty, … }) }, [isDirty, errors])
…
console.log("📋 Form data:", JSON.stringify(data, null, 2))   // name, phone, home address

Nine console.log calls, all in this one file — it is the only non-test file under features/profile that has any.

3. The "read-only" email field is editable in the DOM

packages/scf-core/features/profile/profile-general-left.tsx:378 sets editable={false}, but the rendered web input reports readOnly: false, disabled: false — it is focusable and typable, with only onChangeText={() => {}} and opacity: 0.7 implying otherwise. (The server ignores email on PATCH, so this is a UI lie rather than a write path, but it fails the "looks disabled, isn't" a11y check.)

Acceptance

  • Clearing the avatar marks the form dirty and persists.
  • All nine console.log calls removed.
  • The email input renders with readOnly/aria-readonly and is excluded from the tab order.

Activity

  1. added
    bug
    agent-ready
    security
    on Aug 12, 2026
  2. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    Part of the profile-building audit rollup: #594

  3. thinkclay commented on Aug 12, 2026

    @thinkclay
    ContributorAuthor

    All three items landed in #597 (they all live in profile-general-left.tsx, so splitting them across PRs would have meant conflicts on the same lines):

    • Avatar could not be cleared — setValue('avatar_path', '', { shouldDirty: true }). Without shouldDirty the Save button stayed disabled and there was no other clear path.
    • PII in the console — all nine console.log calls removed. The two remaining console.error calls are genuine error logging and stay.
    • Read-only email was editable — now readOnly + aria-readonly and out of the tab order. editable={false} alone never reached the DOM on web; the rendered input reported readOnly:false, disabled:false.

    Also folded in while there: a rejected submit now toasts, where previously validation failure was console.log-only so the Save button looked like it had simply done nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Frontendagent-readybugpriority: mediumsecuritytype: frontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions