@deeeed/metamask-harness 0.51.0 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.51.1 - 2026-09-13
6
+
7
+ ### Fixed
8
+
9
+ - Mobile native builds run `expo run:ios` / `run:android` with `--no-bundler` (and without `--port`, which Expo refuses next to it): the harness owns Metro on the watcher port, and Expo's post-build port re-check (lsof under a 350 ms budget) aborted a successful 45-minute build on a loaded machine with "Port became busy running another process while the app was compiling".
10
+ - Mobile `verify` waits for the React Native bridge to settle (bounded, best effort) before its live smoke, so a checkout is no longer reported not ready when the app is still hydrating right after a launch or a fixture unlock. `mm-harness prepare` on a fresh full slot build had failed at the final `verify` step this way while a retry a minute later passed.
5
11
  ## 0.51.0 - 2026-09-13
6
12
 
7
13
  ### Added
@@ -126,6 +126,31 @@ source() {
126
126
  mm_harness_restore_build_target
127
127
  return "$status"
128
128
  }
129
+ # The harness owns Metro on WATCHER_PORT. Expo's own bundler management
130
+ # re-checks that port after the build with lsof under a 350 ms budget, which a
131
+ # loaded machine misses, and then aborts with "Port became busy". Build only:
132
+ # --no-bundler, which Expo refuses next to --port, so the port argument goes.
133
+ mm_harness_expo_build_args() {
134
+ local arg skip=false
135
+ MM_HARNESS_EXPO_ARGS=()
136
+ for arg in "$@"; do
137
+ if [ "$skip" = true ]; then skip=false; continue; fi
138
+ case "$arg" in
139
+ --port) skip=true; continue ;;
140
+ --port=*) continue ;;
141
+ esac
142
+ MM_HARNESS_EXPO_ARGS+=("$arg")
143
+ done
144
+ MM_HARNESS_EXPO_ARGS+=(--no-bundler)
145
+ }
146
+ yarn() {
147
+ if [ "${1:-}" = expo ] && [ "${2:-}" = run:ios ]; then
148
+ mm_harness_expo_build_args "$@"
149
+ command yarn "${MM_HARNESS_EXPO_ARGS[@]}"
150
+ else
151
+ command yarn "$@"
152
+ fi
153
+ }
129
154
  mm_harness_restore_build_target
130
155
  BUILD_ENV
131
156
  } > "$build_env"
@@ -317,9 +342,24 @@ source() {
317
342
  mm_harness_restore_android_build_target
318
343
  return "$status"
319
344
  }
345
+ # --no-bundler without --port: the harness owns Metro on WATCHER_PORT (see the
346
+ # iOS build env for why).
347
+ mm_harness_expo_build_args() {
348
+ local arg skip=false
349
+ MM_HARNESS_EXPO_ARGS=()
350
+ for arg in "$@"; do
351
+ if [ "$skip" = true ]; then skip=false; continue; fi
352
+ case "$arg" in
353
+ --port) skip=true; continue ;;
354
+ --port=*) continue ;;
355
+ esac
356
+ MM_HARNESS_EXPO_ARGS+=("$arg")
357
+ done
358
+ }
320
359
  yarn() {
321
360
  if [ "${1:-}" = expo ] && [ "${2:-}" = run:android ]; then
322
- command yarn "$@" "$MM_HARNESS_BUILD_ANDROID_EXPO_DEVICE"
361
+ mm_harness_expo_build_args "$@"
362
+ command yarn "${MM_HARNESS_EXPO_ARGS[@]}" "$MM_HARNESS_BUILD_ANDROID_EXPO_DEVICE" --no-bundler
323
363
  else
324
364
  command yarn "$@"
325
365
  fi
@@ -414,6 +414,30 @@ if [ "$STATIC_ONLY" = false ]; then
414
414
 
415
415
  port_holder_json "$port" > "$ARTIFACTS/logs/port-holder.json"
416
416
 
417
+ # Right after a launch or a fixture unlock the app's JS thread can stay busy
418
+ # for a while (account hydration); a single CDP probe then times out although
419
+ # the runtime is healthy. When Metro holds the port, let wait-for-bridge
420
+ # absorb that settle before the smoke. Best effort and bounded: the smoke
421
+ # below is the check that counts. The installed overlay carries only this
422
+ # script, so the waiter is resolved from the runner source it was installed
423
+ # from.
424
+ if [ "$status" != "fail" ] && node -e 'process.exit(JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")).listening ? 0 : 1)' "$ARTIFACTS/logs/port-holder.json" 2>/dev/null; then
425
+ wait_sh=""
426
+ for candidate in "$SCRIPT_DIR/wait-for-bridge.sh" "$(cat "$HARNESS_DIR/runner/.runner-source" 2>/dev/null || true)/adapters/mobile/wait-for-bridge.sh"; do
427
+ [ -f "$candidate" ] && { wait_sh="$candidate"; break; }
428
+ done
429
+ if [ -z "$wait_sh" ]; then
430
+ add_note "Mobile bridge settle skipped: wait-for-bridge.sh not found beside verify.sh or under runner/.runner-source; reinstall the runner."
431
+ elif MOBILE_BRIDGE_READY_TIMEOUT_MS="${MOBILE_BRIDGE_READY_TIMEOUT_MS:-90000}" \
432
+ MOBILE_BRIDGE_UNRESPONSIVE_GRACE_MS="${MOBILE_BRIDGE_UNRESPONSIVE_GRACE_MS:-90000}" \
433
+ bash "$wait_sh" --target "$TARGET" --port "$port" --platform "$PLATFORM" \
434
+ > "$ARTIFACTS/logs/wait-for-bridge.log" 2>&1; then
435
+ add_note "Mobile bridge settled before the live smoke (logs/wait-for-bridge.log)."
436
+ else
437
+ add_note "Mobile bridge settle did not complete (waiter exit $?); running the live smoke anyway (logs/wait-for-bridge.log)."
438
+ fi
439
+ fi
440
+
417
441
  cat > "$ARTIFACTS/mobile-v1-live-smoke.recipe.json" <<'JSON'
418
442
  {
419
443
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.51.0",
3
+ "version": "0.51.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"