fix(mobile): wire mirror retry to drawer profile picture#14349
Merged
Conversation
ProfilePicture dropped the `onError` callback returned by
`useProfilePicture`, so render-time image failures never reached
`useImageSize` — the mirror retry could only fire on prefetch failures.
A slow validator node that accepted the prefetch but stalled the actual
render would leave the avatar hung indefinitely (OS TCP timeout is
60–90s with no `onError` fired).
Changes:
- `ProfilePicture`: forward `onError` (chained with caller's), pass
`priorityLowResSource`, and set `timeoutMs={3000}` so stalled URLs
advance to the next mirror.
- `UserImage`: add matching `timeoutMs={3000}` for parity.
- Harmony-native `Image`: add optional `timeoutMs` prop (default 0/off).
When >0 and source is a remote URI, synthesize an `onError` if neither
`onLoad` nor `onError` fires in the window. Mirrors the web
`MirrorImage` pattern.
- `Artwork`: plumb `timeoutMs` through so `Avatar → Artwork → Image`
wires it end-to-end.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
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.
Summary
Fixes reports of the left-drawer profile picture not loading on mobile.
The drawer's
<ProfilePicture />was dropping theonErrorcallback returned byuseProfilePicture, so render-time image failures never reacheduseImageSize— the mirror retry could only fire on prefetch failures. A slow Open Audio Validator Node that accepted the prefetch but stalled the actual render would leave the avatar hung indefinitely (the OS TCP timeout is 60–90s with noonErrorfired).Changes
ProfilePicture— forwardonError(chained with the caller's), passpriorityLowResSourcethrough, and settimeoutMs={3000}so stalled URLs advance to the next mirror.UserImage— add matchingtimeoutMs={3000}for parity.Image— add optionaltimeoutMsprop (default0= disabled, preserving existing behavior everywhere else). When> 0and the source is a remote URI, synthesize anonErrorif neitheronLoadnoronErrorfires within the window. Mirrors the webMirrorImagepattern.Artwork— plumbtimeoutMsthrough soAvatar → Artwork → Imageis wired end-to-end.Why this works
useImageSizealready has all the mirror-retry logic: it tracksfailedUrls, swaps in the next mirror's hostname viagetNextMirrorUrl, and re-renders. It just needed render-time failures (including timeouts) to be reported back. With thetimeoutMs={3000}opt-in, hung connections become syntheticonErrors after 3s, matching the global pattern documented for the web client.The fix is scoped: harmony
Image's default istimeoutMs={0}(off), so unrelated image usages across the app keep their existing semantics.Test plan
Artwork/Imageusages render normally (they default totimeoutMs=0, so behavior is unchanged)🤖 Generated with Claude Code