Skip to content

[eas-cli] gate device-run-session serve-sim with the session token - #4306

Open
gwdp wants to merge 1 commit into
gwdp/serve-sim-preview-token-clifrom
gwdp/serve-sim-require-token
Open

[eas-cli] gate device-run-session serve-sim with the session token#4306
gwdp wants to merge 1 commit into
gwdp/serve-sim-preview-token-clifrom
gwdp/serve-sim-require-token

Conversation

@gwdp

@gwdp gwdp commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Why

serve-sim can now require a session token before it serves anything (assuming expo/serve-sim#49 merge). This turns that on for device run sessions.

How

Pass --require-token when we start serve-sim, then carry the token:

  • Read it from serve-sim state file
  • Send it to www as its own field, previewToken or webPreviewToken; Usage on expo/universe#30571
  • Send it as a bearer header on the /metrics stream we collect, which is gated now

Needs a serve-sim release with the flag first. An older serve-sim rejects the unknown option and will not start, so this should land after that publishes.

Test Plan

  • CI
  • Local test with new serve-sim

@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch 2 times, most recently from 29e0327 to 3a32d5c Compare August 28, 2026 21:35
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.43%. Comparing base (c2ad60b) to head (70244c4).

Files with missing lines Patch % Lines
...c/steps/functions/startAgentDeviceRemoteSession.ts 0.00% 1 Missing ⚠️
...ls/src/steps/functions/startAppiumRemoteSession.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           gwdp/serve-sim-preview-token-cli    #4306      +/-   ##
====================================================================
+ Coverage                             65.42%   65.43%   +0.02%     
====================================================================
  Files                                  1058     1058              
  Lines                                 49096    49113      +17     
  Branches                              10354    10362       +8     
====================================================================
+ Hits                                  32116    32133      +17     
  Misses                                16863    16863              
  Partials                                117      117              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp
gwdp requested a review from szdziedzic August 28, 2026 21:59
@gwdp
gwdp marked this pull request as ready for review August 28, 2026 22:14
@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch 3 times, most recently from 74fa11b to d48b193 Compare August 29, 2026 02:32
Comment thread packages/build-tools/src/steps/functions/startArgentRemoteSession.ts Outdated

@szdziedzic szdziedzic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] EAS CLI prints preview URLs without the token. The CLI query still requests only previewUrl/webPreviewUrl, then prints the bare URL. Gated serve-sim returns 401 for those links. Request previewToken/webPreviewToken in DeviceRunSessionQuery.ts, regenerate types, and append ?token= when formatting preview instructions. This affects every iOS session type; serve-sim-only sessions become unusable from the CLI.

Comment thread packages/build-tools/src/steps/utils/remoteDeviceRunSession.ts Outdated
@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch from d48b193 to 96e96aa Compare August 31, 2026 16:04
@gwdp
gwdp changed the base branch from main to gwdp/serve-sim-preview-token-cli August 31, 2026 16:04
@gwdp

gwdp commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

[P1] EAS CLI prints preview URLs without the token. The CLI query still requests only previewUrl/webPreviewUrl, then prints the bare URL. Gated serve-sim returns 401 for those links. Request previewToken/webPreviewToken in DeviceRunSessionQuery.ts, regenerate types, and append ?token= when formatting preview instructions. This affects every iOS session type; serve-sim-only sessions become unusable from the CLI.

Yep, I inverted order here; expo/universe#30570 was coming, but I missed that it needs to be before this.

Deploy order: #30628#30571 → serve-sim#49 publish → #4312#4306.

@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch from 96e96aa to cd68117 Compare August 31, 2026 16:32
@gwdp
gwdp force-pushed the gwdp/serve-sim-preview-token-cli branch from c2cf041 to 98804dd Compare August 31, 2026 21:08
@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch from cd68117 to a006de4 Compare August 31, 2026 21:09
@gwdp
gwdp force-pushed the gwdp/serve-sim-preview-token-cli branch from 98804dd to c2ad60b Compare August 31, 2026 21:29
@gwdp
gwdp force-pushed the gwdp/serve-sim-require-token branch from a006de4 to 70244c4 Compare August 31, 2026 21:37
@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown

ENG-22303

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@gwdp
gwdp requested a review from szdziedzic August 31, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants