Skip to content

Fix receiving messages and sending messages by ensuring we use the latest conversation key#93

Merged
Selyatin merged 5 commits intomainfrom
fix-receiving-websocket-messages
Mar 24, 2026
Merged

Fix receiving messages and sending messages by ensuring we use the latest conversation key#93
Selyatin merged 5 commits intomainfrom
fix-receiving-websocket-messages

Conversation

@Selyatin
Copy link
Copy Markdown
Collaborator

This PR fixes improper code that did not use the proper keyVersion field to compare conversation key versions.

It also adds the missing query parameter for settings.json endpoint.

@Selyatin Selyatin enabled auto-merge (squash) March 20, 2026 21:40
@Selyatin Selyatin disabled auto-merge March 20, 2026 21:40
API_BASE_URL = "https://" + API_BASE_HOST

ACCOUNT_SETTINGS_URL = API_BASE_URL + "/1.1/account/settings.json"
ACCOUNT_SETTINGS_URL = BASE_URL + "/i/api/1.1/account/settings.json"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks wrong, official web client does this:
image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason even with the correct URL it wasn't working (404), apparently we were only using the ScreenName out of the result anyways, so replaced it with a proper user profile API fetch, which also fixes issues related to user profile info not updating.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The endpoint exists, but will throw a fake 404 if SignTransaction didn't work, which might cause random issues in other endpoints as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the ondemand script parsing and tested with https://api.x.com/1.1/account/settings.json endpoint, it was successful.

I think we should keep using the new API to fetch the user profile though as we were only using the ScreenName, whereas the new API provides complete user profile info. LMK what do you think.

@Selyatin Selyatin requested a review from tulir March 22, 2026 20:37
@Selyatin Selyatin merged commit eef320d into main Mar 24, 2026
11 checks passed
@Selyatin Selyatin deleted the fix-receiving-websocket-messages branch March 24, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants