From c941ef077ca05b558339aa0c96b27e226918e2ff Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 12 Oct 2026 12:50:25 -0700 Subject: [PATCH 1/2] fix(e2e): connect the mobile suite to realtime and give dev-server round trips the server budget - Start the realtime server for the mobile group. Without it every workspace page raised a persistent "Reconnecting..." toast ~2s after load; on the locked-workflow reload it raced the lock toast and, when it arrived second, sat in front of the Unlock Workflow action, so the tap timed out on "subtree intercepts pointer events" - Wait 120s, the suite's budget for a next dev round trip, for the URL after a sidebar link tap, the Files list after it, and the table cell after a reload. next dev spent 16.4s (application code 70ms) serving the /home RSC payload and left the rows request unanswered past 20s - Install the browsers while the app boots --- .github/scripts/http-e2e.sh | 41 ++++++++++++++++++++++++----- apps/sim/scripts/test-mobile-e2e.ts | 12 ++++++--- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/scripts/http-e2e.sh b/.github/scripts/http-e2e.sh index ef9c500bd1d..eb824af15e9 100755 --- a/.github/scripts/http-e2e.sh +++ b/.github/scripts/http-e2e.sh @@ -26,6 +26,8 @@ server_pid='' app_tag='' server_log='' status_log='' +realtime_pid='' +realtime_tag='' finish() { local status=$? @@ -39,6 +41,10 @@ finish() { tail -n 200 "$server_log" fi fi + if [ -n "$realtime_pid" ]; then + bash "$GITHUB_WORKSPACE/.github/scripts/stop-session.sh" "$realtime_pid" "$realtime_tag" || status=1 + wait "$realtime_pid" 2>/dev/null || true + fi exit "$status" } trap finish EXIT @@ -58,20 +64,38 @@ start_app() { E2E_APP="$app_tag" setsid node ../../node_modules/next/dist/bin/next dev --hostname 127.0.0.1 \ --port "$port" > "$server_log" 2>&1 & server_pid=$! + wait_ready "$server_pid" "$NEXT_PUBLIC_APP_URL/api/health" "$label app" +} + +# start_realtime : the Socket.IO server the app's browser clients connect to, so pages +# render connected rather than under a "Reconnecting..." notification. Start after start_app, which +# exports the app URL the server allows as an origin; NEXT_PUBLIC_SOCKET_URL must already be set +# when the app starts. +start_realtime() { + local name=$1 port=$2 + realtime_tag="$name-realtime-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-$$" + (cd ../realtime && PORT="$port" E2E_APP="$realtime_tag" exec setsid bun run start \ + > "$report_dir/$name-realtime.log" 2>&1) & + realtime_pid=$! + wait_ready "$realtime_pid" "http://127.0.0.1:$port/health" "$name realtime server" +} +# wait_ready