From 583934efd27f6a33bc2f8a908a9e1955c6ed537f Mon Sep 17 00:00:00 2001 From: Bryce Kalow Date: Mon, 8 Dec 2025 22:17:12 -0600 Subject: [PATCH 1/4] fixes multi session switching e2e test --- integration/tests/session-tasks-multi-session.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/integration/tests/session-tasks-multi-session.test.ts b/integration/tests/session-tasks-multi-session.test.ts index 7e923f6f957..a0ded13f49a 100644 --- a/integration/tests/session-tasks-multi-session.test.ts +++ b/integration/tests/session-tasks-multi-session.test.ts @@ -67,11 +67,12 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })( await u.po.signIn.continue(); // Sign-in again back with active session - await u.po.signIn.goTo(); - await u.po.signIn.setIdentifier(user1.email); - await u.po.signIn.continue(); - await u.po.signIn.setPassword(user1.password); - await u.po.signIn.continue(); + await u.page.goToRelative('/'); + await u.po.userButton.waitForMounted(); + await u.po.userButton.toggleTrigger(); + await u.po.userButton.waitForPopover(); + await u.po.userButton.switchAccount(user1.email); + await u.po.userButton.waitForPopoverClosed(); // Navigate to protected page, with active session, where user button gets rendered await u.page.goToRelative('/user-button'); From f90cb34a770f669fe6b4111a8d1cea00223ddf69 Mon Sep 17 00:00:00 2001 From: Bryce Kalow Date: Mon, 8 Dec 2025 23:10:03 -0600 Subject: [PATCH 2/4] add delay before session switch --- integration/tests/session-tasks-multi-session.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration/tests/session-tasks-multi-session.test.ts b/integration/tests/session-tasks-multi-session.test.ts index a0ded13f49a..e2f96ade9fe 100644 --- a/integration/tests/session-tasks-multi-session.test.ts +++ b/integration/tests/session-tasks-multi-session.test.ts @@ -66,7 +66,9 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })( await u.po.signIn.setPassword(user2.password); await u.po.signIn.continue(); - // Sign-in again back with active session + await new Promise(resolve => setTimeout(resolve, 1000)); + + // Select the active session await u.page.goToRelative('/'); await u.po.userButton.waitForMounted(); await u.po.userButton.toggleTrigger(); From 960bddddb279515e365decf635d48b2661893493 Mon Sep 17 00:00:00 2001 From: Bryce Kalow Date: Mon, 8 Dec 2025 23:19:17 -0600 Subject: [PATCH 3/4] adds comment --- integration/tests/session-tasks-multi-session.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration/tests/session-tasks-multi-session.test.ts b/integration/tests/session-tasks-multi-session.test.ts index e2f96ade9fe..7e965d97ac0 100644 --- a/integration/tests/session-tasks-multi-session.test.ts +++ b/integration/tests/session-tasks-multi-session.test.ts @@ -66,6 +66,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })( await u.po.signIn.setPassword(user2.password); await u.po.signIn.continue(); + // If the subsequent session touch call happens too quickly, the backend will rate limit it and not update the session activity timestamp. + // To get around this rate limit, and realistically emulate a more human-like pace, we add an arbitrary delay here await new Promise(resolve => setTimeout(resolve, 1000)); // Select the active session From 5ff349e0dccff406c66ebc64166ad642c6bef6ea Mon Sep 17 00:00:00 2001 From: Bryce Kalow Date: Mon, 8 Dec 2025 23:21:05 -0600 Subject: [PATCH 4/4] update timeout to 3s --- integration/tests/session-tasks-multi-session.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/tests/session-tasks-multi-session.test.ts b/integration/tests/session-tasks-multi-session.test.ts index 7e965d97ac0..da265d1f693 100644 --- a/integration/tests/session-tasks-multi-session.test.ts +++ b/integration/tests/session-tasks-multi-session.test.ts @@ -68,7 +68,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })( // If the subsequent session touch call happens too quickly, the backend will rate limit it and not update the session activity timestamp. // To get around this rate limit, and realistically emulate a more human-like pace, we add an arbitrary delay here - await new Promise(resolve => setTimeout(resolve, 1000)); + await new Promise(resolve => setTimeout(resolve, 3000)); // Select the active session await u.page.goToRelative('/');