Allow for more URL changes during login#657
Merged
Merged
Conversation
Member
Author
|
Scratch that -- I just reproduced it, and this seems to fix it for me. |
redshiftzero
approved these changes
Jun 6, 2026
Contributor
redshiftzero
left a comment
There was a problem hiding this comment.
I didn't repro the original issue, but this makes sense and login still works
Contributor
|
Actually I take that back, I was able to reproduce this bug while testing #658, I cherry-picked this commit into that branch and confirmed it resolves :) |
Merged
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.
I got a report from a Cyd user that 1) they were trying to login to their X account and it wasn't detecting it and 2) the UI for archive-only mode was confusing.
This PR addresses the first one. I'm not reproducing the issue, but I think this fixes it anyway, based on the error report they submitted. The login function includes:
It loads
https://x.com/login, and the other two URLs (https://x.com/homeandhttps://x.com/i/flow/login) are expected to load. Once it finally makes it tohttps://x.com/home, it concludes that the login was successful.Based on the error report, it actually tried loading
https://x.com/i/jf/onboarding/web?mode=login, which triggered an error. It seems that X changed their login flow, at least for this user. So to keep things simpler and more robust, I've changed it so that any URL that starts withhttps://x.com/i/is an expected URL and won't throw an error. This should allow URLs likehttps://x.com/i/jf/onboarding/web?mode=loginthrough, and allow for completing the login.This is from the error report that they submitted:
{ "logs": [ { "timestamp": "2026-06-04T21:08:34.551Z", "func": "run", "message": "running state: Login" }, { "timestamp": "2026-06-04T21:08:34.551Z", "func": "login", "message": "logging in" }, { "timestamp": "2026-06-04T21:08:34.551Z", "func": "loadURLWithRateLimit", "message": [ "https://x.com/login", [ "https://x.com/home", "https://x.com/i/flow/login" ], false ] }, { "timestamp": "2026-06-04T21:08:34.552Z", "func": "waitForLoadingToFinish", "message": "waiting for loading to finish" }, { "timestamp": "2026-06-04T21:08:34.605Z", "func": "domReadyHandler", "message": "dom-ready" }, { "timestamp": "2026-06-04T21:08:34.753Z", "func": "waitForLoadingToFinish", "message": "loading finished" }, { "timestamp": "2026-06-04T21:08:34.753Z", "func": "loadURL", "message": "try #0, https://x.com/login" }, { "timestamp": "2026-06-04T21:08:35.959Z", "func": "loadURL", "message": "URL loaded successfully" }, { "timestamp": "2026-06-04T21:08:35.959Z", "func": "waitForLoadingToFinish", "message": "waiting for loading to finish" }, { "timestamp": "2026-06-04T21:08:36.160Z", "func": "waitForLoadingToFinish", "message": "loading finished" }, { "timestamp": "2026-06-04T21:08:36.160Z", "func": "loadURLWithRateLimit", "message": "URL loaded successfully" }, { "timestamp": "2026-06-04T21:08:36.160Z", "func": "loadURLWithRateLimit", "message": "checking if URL changed" }, { "timestamp": "2026-06-04T21:08:36.161Z", "func": "loadURLWithRateLimit", "message": "UNEXPECTED, URL change to https://x.com/i/jf/onboarding/web?mode=login" } ], "currentURL": "https://x.com/i/jf/onboarding/web?mode=login" }