Skip to content

Recognise TrUAPI hosts that inject only the frame transport - #48

Merged
todortodorovic merged 1 commit into
mainfrom
fix/detect-truapi-transport
Nov 19, 2026
Merged

todortodorovic merged 1 commit into
mainfrom
fix/detect-truapi-transport

Conversation

@todortodorovic

Copy link
Copy Markdown
Collaborator

Why

trinity-user-agents #2193 (merged 2026-11-19) changes what the TrUAPI container puts on window:

  • It no longer publishes window.__HOST_API_CLIENT__.
  • It publishes window.__HOST_API_TRANSPORT__ instead.
  • It keeps a legacy window.__HOST_API_PORT__ for SDKs below 0.32, and still consumes __truapi_localhost.

awaitHostRuntime() recognised TrUAPI only by __HOST_API_CLIENT__ or __truapi_localhost. On a host with #2193 it would see neither marker, wait 3 s and load the codec-1 client, which the Rust core does not answer. Account, payments and storage would all fail. The first nightlies with #2193 are expected tonight. The current nightlies (2ad4a9e) and release builds (codec 1) are not affected.

What

  • lib/host/detect.ts: __HOST_API_TRANSPORT__ now counts as a TrUAPI marker, alongside the existing two.
  • Our SDK (product-sdk-host 0.30.1 / truapi 0.26) then talks over the legacy __HOST_API_PORT__, which the host keeps for SDKs like it. No dependency change: the latest published truapi (0.31.0) does not know the new transport either. We move to 0.32 once it is out, before the host drops the port.
  • lib/host/sdk.ts: comment only.

Testing

  • Two new unit tests in tests/host-runtime-codec.test.ts: a host that injects only the transport, and a transport that lands late. Both fail on the old detect.ts.
  • 209 unit tests pass; tsc and lint are clean.
  • e2e was not run: the test host is a codec-1 iframe, which this change does not touch.
  • Still to do: a phone check on the first nightly that includes #2193.

Since trinity-user-agents #2193 the TrUAPI container no longer publishes
window.__HOST_API_CLIENT__. It publishes window.__HOST_API_TRANSPORT__
instead, keeps a legacy __HOST_API_PORT__ for SDKs below 0.32, and still
consumes __truapi_localhost. awaitHostRuntime() saw none of its markers,
waited 3 s and picked the codec-1 client, which the Rust core does not
answer.

Treat __HOST_API_TRANSPORT__ as a TrUAPI marker. Our SDK (truapi 0.26)
then talks over the legacy port, which the host keeps for SDKs like it.
@github-actions

Copy link
Copy Markdown

pr48-terminal.paseo · logs

https://pr48-terminal.paseo.li

@todortodorovic
todortodorovic merged commit 2e79483 into main Nov 19, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
preview — 96fd7eb2 Deployed Nov 19, 2026 by todortodorovic via deploy #86
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.

1 participant