Skip to content

Commit 01dadd8

Browse files
committed
fix(e2e): wait for /auth/me before composio RPC in mega-flow scenarios 4 and 11
auth_store_session calls GET /auth/me internally; without waiting for it the session token may not be stored yet and composio_list_triggers / composio_enable_trigger fail with "no backend session token". Matches the pattern already used in Scenario 1.
1 parent 8c13e6d commit 01dadd8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎app/test/e2e/specs/mega-flow.spec.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,13 @@ describe('Mega flow — login + Gmail OAuth + Composio in one session', () => {
234234
it('Composio: enable_trigger via RPC mutates the active-triggers list', async () => {
235235
await resetEverything('after Scenario 3');
236236

237-
// Re-login since reset wipes the session.
237+
// Re-login to establish a fresh session for this scenario.
238238
await triggerDeepLink('openhuman://auth?token=mega-composio-token');
239239
await waitForMockRequest('POST', '/telegram/login-tokens/', 15_000);
240+
// Wait for auth_store_session to complete (it calls GET /auth/me internally).
241+
// Without this wait the session token may not be stored yet and composio
242+
// RPC calls fail with "no backend session token".
243+
await waitForMockRequest('GET', '/auth/me', 10_000);
240244

241245
// Seed connections + available triggers; start with an empty active list.
242246
setMockBehaviors({
@@ -561,6 +565,8 @@ describe('Mega flow — login + Gmail OAuth + Composio in one session', () => {
561565

562566
await triggerDeepLink('openhuman://auth?token=mega-composio-webhook-token');
563567
await waitForMockRequest('POST', '/telegram/login-tokens/', 15_000);
568+
// Wait for auth_store_session to complete before using composio RPC.
569+
await waitForMockRequest('GET', '/auth/me', 10_000);
564570
clearRequestLog();
565571

566572
// Seed composio state.

0 commit comments

Comments
 (0)