Skip to content

Fix profile modal stuck on the spinner when the latest tweet is truncated - #573

Merged
dimdenGD merged 1 commit into
dimdenGD:mainfrom
hiver:fix-profile-spinner-truncated-status
Nov 11, 2026
Merged

dimdenGD merged 1 commit into
dimdenGD:mainfrom
hiver:fix-profile-spinner-truncated-status

Conversation

@hiver

@hiver hiver commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Opening the profile of some accounts leaves the modal on its loading spinner forever. Nothing is logged in the console.

When it happens

  • The account is not in OTD's user cache yet, so OTD calls users/show.json.
  • The account's latest tweet ends with "…" and is 100 to 399 characters long (a long post, or a retweet of one).

Cause

users/show.json embeds the latest tweet as status, without a user object. TwitterUser.fromJSONObject builds lastStatus from it and sets lastStatus.user only afterwards. While it is being built, TwitterStatus._generateHTMLText adds the "Expand tweet" link and reads this.user.screenName, which throws because this.user is still undefined. The exception is swallowed inside the Deferred chain, so neither the success nor the error handler of the profile modal runs.

Fix

Fall back to https://twitter.com/i/status/<id> when the status has no user (one line in files/bundle.js).

How it was tested

The real profile component, user cache, API client and user parser from files/bundle.js were loaded in an isolated page with only the transport stubbed, using a response shaped like users/show.json:

latest tweet before after
short opens opens
long, cut off with "…" spinner opens
retweet of such a tweet spinner opens

Not tested: the patched bundle in a live, logged-in OTD session.

I used Claude (an AI assistant) to track this down, write the fix and run the test above. The commit is co-authored accordingly.

users/show.json embeds the latest tweet as `status` without a `user`
object. TwitterUser.fromJSONObject builds lastStatus from it and sets
lastStatus.user only afterwards, so _generateHTMLText throws on
this.user.screenName while adding the "Expand tweet" link to a tweet
that ends with "…". The exception is swallowed by the Deferred chain
and the profile modal stays on its spinner.

Fall back to https://twitter.com/i/status/<id> when the status has no
user.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgJm3VTmJ9WHQjoyaBDJFY
@dimdenGD
dimdenGD merged commit 49ec8a4 into dimdenGD:main Nov 11, 2026
1 check passed
dimdenGD added a commit that referenced this pull request Nov 11, 2026
Fix profile modal stuck on the spinner when the latest tweet is truncated
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