Skip to content

fix: prefer DOM avatar in twitter profile card - #12443

Merged
guanbinrui merged 2 commits into
developfrom
fix/profile-card-dom-avatar
Sep 6, 2026
Merged

fix: prefer DOM avatar in twitter profile card#12443
guanbinrui merged 2 commits into
developfrom
fix/profile-card-dom-avatar

Conversation

@swkatmask

Copy link
Copy Markdown
Contributor

Problem

The Web3 profile card's avatar comes from FireflyTwitter.getUserInfolegacy.profile_image_url_https. That API serves long-lived cached snapshots, and Twitter deletes profile images when a user changes their avatar — so the cached URL 404s, <Image> hits onError, and the card renders the mask-light fallback.

Repro (hover card on @suji_yan):

  • API avatar: .../1755533702241964032/zsuAW0vI_normal.jpg404
  • page DOM avatar: .../2059408043180544000/Kr_FNdBv_400x400.jpg → loads fine

Fix

Mirror the logic collecting/identity.ts already uses for the visiting identity (with the same rationale — "DOM avatar is more accurate, avatar from api could be outdate"): when the profile page for that handle is open, prefer the DOM avatar a[href="/<handle>/photo"] img; fall back to the API URL otherwise (hover cards on timelines).

The select is local to this component, so the shared ['twitter', 'profile', handle] react-query cache is untouched.

Root-cause fix on the backend (snapshot TTL): DimensionDev/Mask-X-Backend#5882

The encrypt+decrypt round-trip runs two KDF-bound operations (~2.7s each
on CI) and exceeded vitest's 5s default when bigint-buffer falls back to
pure JS. Seen failing on CI in #12443.
@guanbinrui
guanbinrui merged commit cb297cc into develop Sep 6, 2026
11 checks passed
@guanbinrui
guanbinrui deleted the fix/profile-card-dom-avatar branch September 6, 2026 03:16
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