Repository navigation
Fix flaky profile picture test in account settings - #35935
Merged
Merged
Conversation
The test homeserver only serves media to authenticated requests, so the thumbnail got a 404 and the avatar fell back to the initial, often before the test saw the image.
Member
|
I think this test should just be disabled on firefox & webkit |
Contributor
Author
|
Agreed, I’ve made the change. The test is now skipped on Firefox and WebKit, and I’ve removed the thumbnail mock. Chrome still runs the test and checks the real thumbnail loads. |
t3chguy
approved these changes
Nov 20, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35267
What was wrong
After uploading a profile picture, Element loads its thumbnail. Firefox and WebKit block service workers in these tests, and Element relies on the service worker to add the access token to media requests. Without the token, the homeserver returns a 404, so Element falls back to the letter "B". The test was flaky because it sometimes passed before the image disappeared.
How I found it
Network logging showed the upload and avatar save returning 200, but the thumbnail request returning 404 every time, whether the test passed or failed.
The fix
Following t3chguy's suggestion, I skipped this test on Firefox and WebKit with
test.skip(browserName !== "chromium", ...)and removed the thumbnail mock. Chrome still runs the test and checks that the real thumbnail loads.Before and after
How to test
Tests only,
T-Taskplease.Checklist
public/exportedsymbols have accurate TSDoc documentation.AI assistance