diff --git a/src/account_x/controller/index/indexParseTweetsResponseData.ts b/src/account_x/controller/index/indexParseTweetsResponseData.ts index faeec72e..3c8e3387 100644 --- a/src/account_x/controller/index/indexParseTweetsResponseData.ts +++ b/src/account_x/controller/index/indexParseTweetsResponseData.ts @@ -148,8 +148,6 @@ export function indexParseTweetsResponseData( .user_results && entries.content.itemContent.tweet_results.result.core.user_results .result && - entries.content.itemContent.tweet_results.result.core.user_results - .result.legacy && entries.content.itemContent.tweet_results.result.core.user_results .result.core && entries.content.itemContent.tweet_results.result.legacy @@ -171,8 +169,6 @@ export function indexParseTweetsResponseData( .user_results && entries.content.itemContent.tweet_results.result.tweet.core .user_results.result && - entries.content.itemContent.tweet_results.result.tweet.core - .user_results.result.legacy && entries.content.itemContent.tweet_results.result.tweet.core .user_results.result.core && entries.content.itemContent.tweet_results.result.tweet.legacy diff --git a/src/renderer/src/view_models/XViewModel/jobs_delete.test.ts b/src/renderer/src/view_models/XViewModel/jobs_delete.test.ts index b8f1d4f9..a92e42b7 100644 --- a/src/renderer/src/view_models/XViewModel/jobs_delete.test.ts +++ b/src/renderer/src/view_models/XViewModel/jobs_delete.test.ts @@ -810,7 +810,7 @@ describe("jobs_delete.ts", () => { // Should load DMs page at least once expect(vm.loadURLWithRateLimit).toHaveBeenCalledWith( - "https://x.com/messages", + "https://x.com/i/chat", ); }); diff --git a/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.test.ts b/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.test.ts index 31bde3c5..e11e4231 100644 --- a/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.test.ts +++ b/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.test.ts @@ -39,7 +39,7 @@ describe("helpers_pages.ts", () => { await DeleteHelpers.deleteDMsLoadDMsPage(vm); expect(vm.loadURLWithRateLimit).toHaveBeenCalledWith( - "https://x.com/messages", + "https://x.com/i/chat", ); }); @@ -48,7 +48,7 @@ describe("helpers_pages.ts", () => { expect(vm.waitForSelector).toHaveBeenCalledWith( 'section input[type="text"]', - "https://x.com/messages", + "https://x.com/i/chat", 30000, ); }); @@ -58,7 +58,7 @@ describe("helpers_pages.ts", () => { expect(vm.waitForSelector).toHaveBeenCalledWith( 'section div div[role="tablist"] div[data-testid="cellInnerDiv"]', - "https://x.com/messages", + "https://x.com/i/chat", ); }); diff --git a/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.ts b/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.ts index d305d32d..61e21311 100644 --- a/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.ts +++ b/src/renderer/src/view_models/XViewModel/jobs_delete/helpers_pages.ts @@ -17,14 +17,14 @@ export async function deleteDMsLoadDMsPage(vm: XViewModel): Promise { success = false; for (tries = 0; tries < 3; tries++) { - await vm.loadURLWithRateLimit("https://x.com/messages"); + await vm.loadURLWithRateLimit("https://x.com/i/chat"); // If the conversations list is empty, there is no search text field try { // Wait for the search text field to appear with a 30 second timeout await vm.waitForSelector( 'section input[type="text"]', - "https://x.com/messages", + "https://x.com/i/chat", 30000, ); } catch (e) { @@ -44,7 +44,7 @@ export async function deleteDMsLoadDMsPage(vm: XViewModel): Promise { ); await vm.waitForSelector( 'section div div[role="tablist"] div[data-testid="cellInnerDiv"]', - "https://x.com/messages", + "https://x.com/i/chat", ); success = true; break; diff --git a/src/renderer/src/view_models/XViewModel/jobs_index.test.ts b/src/renderer/src/view_models/XViewModel/jobs_index.test.ts index 7b97084d..355a48c6 100644 --- a/src/renderer/src/view_models/XViewModel/jobs_index.test.ts +++ b/src/renderer/src/view_models/XViewModel/jobs_index.test.ts @@ -468,7 +468,7 @@ describe("jobs_index.ts", () => { vi.spyOn(vm, "waitForSelector") .mockResolvedValueOnce(undefined) // search field .mockRejectedValueOnce( - new URLChangedError("https://x.com/messages", "https://x.com/other"), + new URLChangedError("https://x.com/i/chat", "https://x.com/other"), ); const result = await IndexJobs.runJobIndexConversations(vm, 0); @@ -629,10 +629,10 @@ describe("jobs_index.ts", () => { await IndexJobs.runJobIndexMessages(vm, 0); expect(vm.loadURLWithRateLimit).toHaveBeenCalledWith( - "https://x.com/messages/conv1", + "https://x.com/i/chat/conv1", ); expect(vm.loadURLWithRateLimit).toHaveBeenCalledWith( - "https://x.com/messages/conv2", + "https://x.com/i/chat/conv2", ); expect(mockElectron.X.indexConversationFinished).toHaveBeenCalledTimes(2); }); @@ -668,7 +668,7 @@ describe("jobs_index.ts", () => { mockElectron.X.indexMessagesStart.mockResolvedValue(mockMessagesData); vi.spyOn(vm, "waitForSelector").mockRejectedValue( new URLChangedError( - "https://x.com/messages/conv1", + "https://x.com/i/chat/conv1", "https://x.com/i/verified-get-verified", ), ); diff --git a/src/renderer/src/view_models/XViewModel/jobs_index.ts b/src/renderer/src/view_models/XViewModel/jobs_index.ts index c8a576bb..548fa5b3 100644 --- a/src/renderer/src/view_models/XViewModel/jobs_index.ts +++ b/src/renderer/src/view_models/XViewModel/jobs_index.ts @@ -48,7 +48,7 @@ export async function runJobIndexTweets( const username = vm.account.xAccount?.username || ""; const url = `https://x.com/${username}/with_replies`; await vm.loadURLWithRateLimit(url); - await vm.sleep(500); + await vm.sleep(2000); // Check if tweets list is empty if ( @@ -202,7 +202,7 @@ export async function runJobIndexConversations( await window.electron.X.resetRateLimitInfo(vm.account.id); // Load the messages page - await vm.loadURLWithRateLimit("https://x.com/messages"); + await vm.loadURLWithRateLimit("https://x.com/i/chat"); vm.log( "runJobIndexConversations", "loaded messages page, waiting for conversations to load", @@ -220,7 +220,7 @@ export async function runJobIndexConversations( // Wait for the search text field to appear with a 30 second timeout await vm.waitForSelector( 'section input[type="text"]', - "https://x.com/messages", + "https://x.com/i/chat", 30000, ); } catch (e) { @@ -237,7 +237,7 @@ export async function runJobIndexConversations( try { await vm.waitForSelector( 'section div div[role="tablist"] div[data-testid="cellInnerDiv"]', - "https://x.com/messages", + "https://x.com/i/chat", ); break; } catch (e) { @@ -405,7 +405,7 @@ export async function runJobIndexMessages(vm: XViewModel, jobIndex: number) { // Load URL and wait for messages to appear try { - url = `https://x.com/messages/${indexMessagesStartResponse.conversationIDs[i]}`; + url = `https://x.com/i/chat/${indexMessagesStartResponse.conversationIDs[i]}`; await vm.loadURLWithRateLimit(url); // Use longer timeout on retries (60 seconds instead of default 30 seconds) const timeout = tries > 0 ? 60000 : undefined; @@ -568,7 +568,7 @@ export async function runJobIndexLikes( const username = vm.account.xAccount?.username || ""; const url = `https://x.com/${username}/likes`; await vm.loadURLWithRateLimit(url); - await vm.sleep(500); + await vm.sleep(2000); // Check if likes list is empty if ( @@ -665,7 +665,7 @@ export async function runJobIndexBookmarks( await window.electron.X.resetRateLimitInfo(vm.account.id); const url = "https://x.com/i/bookmarks"; await vm.loadURLWithRateLimit(url); - await vm.sleep(500); + await vm.sleep(2000); // Check if bookmarks list is empty if (