Skip to content

fix(settings): Fix avatar deletion failing#20236

Merged
LZoog merged 1 commit intomainfrom
FXA-13300
Mar 23, 2026
Merged

fix(settings): Fix avatar deletion failing#20236
LZoog merged 1 commit intomainfrom
FXA-13300

Conversation

@LZoog
Copy link
Copy Markdown
Contributor

@LZoog LZoog commented Mar 21, 2026

Because:

  • After an avatar upload, if a user refreshes or just goes back to Settings at a different point in time, we are hitting /v/profile/default to delete the avatar instead of sending the avatar ID, causing a 400 but giving the user visual feedback that the avatar has been removed

This commit:

  • Fetches v1/avatar alongside v1/profile to get the current avatar ID
  • Falls back to null instead of 'default' when no avatar ID is available
  • Adjusts the functional test to account for this

closes FXA-13300


If you copy and paste the functional test changes into main you will see it fail.

Because:
* After an avatar upload, if a user refreshes or just goes back to Settings at a different point in time, we are hitting /v/profile/default to delete the avatar instead of sending the avatar ID, causing a 400 but giving the usual visual feedback that the avatar has been removed

This commit:
* Fetches v1/avatar alongside v1/profile to get the current avatar ID
* Falls back to null instead of 'default' when no avatar ID is available
* Adjusts the functional test to account for this

closes FXA-13300
@LZoog LZoog requested a review from a team as a code owner March 21, 2026 00:23
// avatar ID to be lost (the /v1/profile endpoint doesn't return it)
await page.reload();
await expect(settings.settingsHeading).toBeVisible();
await expect(settings.avatar.photo).not.toHaveAttribute('src', /avatar/);
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.

Had to do a double take .not.toHaveAttribute means the user has an avatar 😅

Copy link
Copy Markdown
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

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

Having some issues starting up my stack but i think the functional test covers this and its pretty low risk.

@LZoog LZoog merged commit 873df01 into main Mar 23, 2026
22 checks passed
@LZoog LZoog deleted the FXA-13300 branch March 23, 2026 15:07
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