fix: prefer DOM avatar in twitter profile card - #12443
Merged
Merged
Conversation
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.
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.
Problem
The Web3 profile card's avatar comes from
FireflyTwitter.getUserInfo→legacy.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>hitsonError, and the card renders the mask-light fallback.Repro (hover card on
@suji_yan):.../1755533702241964032/zsuAW0vI_normal.jpg→ 404.../2059408043180544000/Kr_FNdBv_400x400.jpg→ loads fineFix
Mirror the logic
collecting/identity.tsalready 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 avatara[href="/<handle>/photo"] img; fall back to the API URL otherwise (hover cards on timelines).The
selectis 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