Repository navigation
Revert "[build-tools] Confine agent-device sessions to the session device" - #4540
Conversation
|
✅ Thank you for adding the changelog entry! |
| sessionHost = await startDeviceSessionHostAsync(ctx, { | ||
| runtimePlatform, | ||
| env, | ||
| logger: taskLogger, | ||
| timeoutMs: STARTUP_TIMEOUT_MS, | ||
| // The daemon policy names this device, so the preview must show the same one. | ||
| device: bootedDevice, | ||
| networkCapture: capture.networkCapture, | ||
| networkCaptureFields: capture.networkCaptureFields, | ||
| }); |
There was a problem hiding this comment.
🔴 Preview can show the wrong simulator
When another simulator is already booted, startDeviceSessionHostAsync starts serve-sim without the session's UDID. Serve-sim can select that other simulator, so the preview shows a different device from the installed app.
Learn more
An agent-device session boots the requested iOS simulator and installs the app there. The session host starts serve-sim after boot, but the new call does not pass the booted simulator's UDID. createServeSimArgs no longer supplies a device argument, and the host no longer checks the ID returned by /readyz. With more than one booted simulator, serve-sim can select a different one, making the preview and app diverge.
Example: The host already has simulator A booted. The session boots B and installs an app on B, but serve-sim selects A. The preview shows A instead of the app on B.
Recommended fix: Preserve the UDID returned by bootIosSimulatorAsync in device.booted, pass it to startDeviceSessionHostAsync, and pass it to serve-sim. Check the ready device against that UDID before reporting the session ready.
Was this helpful? React with 👍 or 👎 to provide feedback.
| stopAsync: async () => { | ||
| await daemonProcess.stopAsync(); | ||
| await fs.promises.rm(installDir, { recursive: true, force: true }); | ||
| }, |
There was a problem hiding this comment.
🟡 Failed daemon shutdown leaves installation behind
If daemonProcess.stopAsync() rejects, stopAsync never removes installDir. Failed session teardown leaves the agent-device installation on disk.
| stopAsync: async () => { | |
| await daemonProcess.stopAsync(); | |
| await fs.promises.rm(installDir, { recursive: true, force: true }); | |
| }, | |
| stopAsync: async () => { | |
| try { | |
| await daemonProcess.stopAsync(); | |
| } finally { | |
| await fs.promises.rm(installDir, { recursive: true, force: true }); | |
| } | |
| }, |
Was this helpful? React with 👍 or 👎 to provide feedback.
| if (!deviceIdentifier) { | ||
| throw new Error('Could not find an iPhone among available simulator devices.'); | ||
| } |
There was a problem hiding this comment.
🟡 Missing iPhone loses server error classification
When no iPhone is available, bootIosSimulatorAsync throws a plain Error instead of SystemError. The failed step loses its SERVER_ERROR classification.
Learn more
The simulator boot helper runs in both the standalone simulator step and agent-device sessions. A missing iPhone is an infrastructure failure, previously represented by SystemError with the SERVER_ERROR error code; a plain Error loses that classification in the build error payload.
Example: A macOS worker lists only iPads. The step fails with a generic error rather than a server error that identifies the device host as the problem.
Recommended fix: Restore the SystemError import and throw new SystemError(...) for this branch.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| ### 🎉 New features | ||
|
|
||
| - [build-tools] Confine agent-device sessions to the session's device and deny booting and shutting down devices, using agent-device's daemon policy. ([#4499](https://github.com/expo/eas-cli/pull/4499) by [@szdziedzic](https://github.com/szdziedzic)) |
| const daemonProcess = spawnDetached({ | ||
| command: 'node', | ||
| args: [daemonPath], | ||
| installDir, | ||
| launchMessage: `Launching daemon from ${daemonPath} after ${add.command} install.`, | ||
| env: { ...env, ...AGENT_DEVICE_DAEMON_ENV }, | ||
| }); |
There was a problem hiding this comment.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4540 +/- ##
==========================================
- Coverage 73.75% 73.71% -0.03%
==========================================
Files 998 998
Lines 48816 48778 -38
Branches 10558 10548 -10
==========================================
- Hits 35997 35953 -44
- Misses 11825 11831 +6
Partials 994 994 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Reverts #4499