Chrome 157 goes stable, and WebUSB's disconnect semantics finally changed

Chrome 157 reached the stable channel on Tuesday, November 3, 2026 — version
157.0.8103.38 on Linux and 157.0.8103.38/.39 on Windows and macOS, with
213 security fixes (7 rated critical, 6 of them memory-safety bugs in
graphics and rendering code). The same build shipped to Chrome for Android
(157.0.8103.38) and Chrome for iOS (157.0.8103.37) the same day. Microsoft
Edge 157 follows on November 5 with the same platform features.

That release is the headline, but the part that actually touches webadb is
smaller and quieter: Chromium’s WebUSB implementation now rejects a pending
transferIn() with NotFoundError when the device is unplugged, instead of
the generic NetworkError the WebUSB specification still describes. Two
upstream projects noticed — the WebUSB spec’s own issue tracker and
ya-webadb — and ya-webadb’s fix is on npm right now, in
@yume-chan/adb-daemon-webusb@3.0.0-beta.4. webadb.online is still running
3.0.0-beta.1. That gap is three weeks wide and it covers a rewrite of the
exact WebUSB writable path our device transport uses.

Chrome 157: the platform webadb actually runs on

The stable channel notes for 157 are modest by recent standards, and most of
it is unrelated to what we do:

  • text-overflow accepts a custom <string> value, so you can render
    " (more)" instead of the ellipsis. Firefox has shipped this since 2011;
    Chrome is catching up roughly fifteen years later. The corner shorthand
    lands too, folding border-radius and corner-shape into one declaration
    (corner: 20px squircle), with per-corner and logical variants.
  • A family of HTML insertion and streaming methods —
    beforeHTML(), afterHTML(), appendHTML(), prependHTML(),
    replaceWithHTML(), plus streamHTML() / streamAppendHTML() returning
    WritableStreams — aimed at replacing insertAdjacentHTML() with one
    coherent, Trusted-Types-aware story. The ChromeStatus entry is still
    marked “pending review”, so we would not ship against it yet.
  • The Sanitizer API grows an explicit javascriptURLs option instead of
    the behaviour being a side effect of which method you called.
  • The Background Fetch API now enforces CORS, closing a bypass where a site
    could skip CORS and Local Network Access checks by using Background Fetch
    instead of fetch().
  • Long Animation Frames gains styleDuration and forcedStyleDuration,
    so you can finally tell whether a janky frame came from style recalc or
    from a script forcing layout.
  • The Language Detector API ships on Android (Clank), and
    BluetoothRemoteGATTServer becomes an EventTarget.

None of that is what we build on. What we build on is navigator.usb, and
the one item in the 157 cycle that touches USB is a WebUSB hardening change
in services/device/usb/mojo/device_impl.cc — commit 89b42d2d, “WebUSB:
Strengthen control transfer protection for protected classes”
, bug
489711638:

1
2
3
4
5
6
Strengthens control transfer permissions to block requests targeting
protected interface classes like HID or Mass Storage. Requests are now
scrutinized for protected interfaces via the wIndex field regardless of
recipient. Standard requests for device-level management remain allowed.
This behavior is gated by the kWebUsbProtectedClassControlTransferBlock
feature flag.

The protected-class list is HID (0x03), mass storage (0x08), and the
other class-code owners the OS already has kernel drivers for. ADB’s interface
is vendor-specific (0xFF), so this does not touch our traffic — but the
mechanism is worth understanding, because it is the same wIndex-based
scrutiny that made the disconnect behaviour change described below legible in
the first place. (Electron cherry-picked this same Chromium commit into
39-x-y on April 1, 2026, so it predates the 157 cycle — it is in the stable
channel already, and is not what I am writing about today. The disconnect
change is.)

The disconnect semantics change, and the spec that did not follow

The interesting change is not in the release notes at all. It is in
whatwg/usb issue #219,
“Can’t detect device disconnection when transferIn is waiting incoming
data”
, filed back in 2022 and still open.

The problem, as originally reported: in a polling design, transferIn() is
called continuously to receive incoming data. If the device disconnects,
transferIn step 14 throws a generic NetworkError. The disconnect event
is fired after the error was thrown (at least on Windows and Chrome), which
makes it impossible to distinguish “the cable fell out” from “the device
misbehaved”. The issue proposes two things: throw NotFoundError from
transferIn when the failure reason is device disconnection, and precisely
define the ordering of the disconnect event, the device.open property
change, and the transferIn rejection.

On 2026-10-01, kvnloo posted the answer as a comment:

Current Chromium looks like it may have moved since this was filed.
USBDevice::OnConnectionError() now rejects every pending
device_requests_ resolver with NotFoundError and "The device was disconnected.", including an outstanding transferIn().

That seems to implement the first suggestion here already. A focused WPT
that starts a pending transferIn(), disconnects the fake device, and
asserts NotFoundError would tell us whether this can now be closed or
whether there is still a platform-specific ordering problem.

Note what this means in practice. The old code path had to guess. The
original Chromium behaviour — and the behaviour the spec still describes —
is that a disconnect surfaces as NetworkError, which is indistinguishable
from a transfer-level failure. The ya-webadb fix for that, in
libraries/adb-daemon-webusb/src/device.ts, is a heuristic: on NetworkError,
sleep 100 ms, then check whether the connection was closed in the meantime,
and only then treat it as a clean disconnect.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
} catch (e) {
// On Windows, disconnecting the device will cause `NetworkError` to be thrown,
// even before the `disconnect` event is fired.
// Wait a little while and check if the device is still connected.
// https://github.com/WICG/webusb/issues/219
if (isErrorName(e, "NetworkError")) {
await new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, 100);
});

if (closed) {
return undefined;
}
}

throw e;
}

That is a timer, a race, and a 100 ms window during which a real error is
indistinguishable from a cable pull. With the new Chromium behaviour there
is no ambiguity at all: NotFoundError means “the device was
disconnected”. The fix that landed on top of it is three lines:

1
2
3
4
5
6
7
8
9
     }

+ // https://github.com/whatwg/usb/issues/219#issuecomment-5937803105
+ if (isErrorName(e, "NotFoundError")) {
+ return undefined;
+ }
+
throw e;
}

return undefined is the sentinel this function already uses for “the
connection ended cleanly, stop the read loop”. So the new path is exact: no
timer, no race, no 100 ms of latency before the UI learns the phone is gone.

The WebUSB specification has not caught up. The draft community group report
is dated 5 June 2026 and still describes the old generic NetworkError
behaviour, and issue #219 remains open pending a focused WPT. That gap is
worth naming, because code written today against the spec rather than
against Chromium will still have the heuristic in it — and the heuristic is
still correct as a fallback for browsers that have not shipped the change.
The two paths coexist in the same catch block, which is the right shape:
NetworkError is ambiguous and needs disambiguation, NotFoundError is not.

What else changed in ya-webadb since beta.1

3.0.0-beta.4 was published to npm on 2026-10-09, the same day as the
release commit 7bcec613. Between v3.0.0-beta.1 and v3.0.0-beta.4 there
are fifteen commits, and two of them touch code that webadb.online runs
directly.

The WebUSB writable path was rewritten

PR #869, “fix(adb): wait
for sync send v1 completion”
, merged 2026-09-17 as 69fffaf0 (co-authored
by Qingyu Wang), rewrote the writable half of
AdbDaemonWebUsbConnection. In beta.1 it was:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
this.#writable = pipeFrom(
duplex.createWritable(
new MaybeConsumable.WritableStream({
write: async (chunk) => {
await device.raw.transferOut(
outEndpoint.endpointNumber,
// WebUSB doesn't support SharedArrayBuffer
// https://github.com/WICG/webusb/issues/243
toLocalUint8Array(chunk),
);
// ... zero-length packet handling ...
},
}),
),
new AdbPacketSerializeStream(),
);

In beta.4 it is:

1
2
3
4
5
6
7
8
9
10
11
const serializeStream = new AdbPacketSerializeStream();
this.#writable = new DelayedCloseWritableStream(
serializeStream.writable,
serializeStream.readable.pipeTo(
duplex.createWritable(
new MaybeConsumable.WritableStream({
write: async (chunk) => { /* same transferOut body */ },
}),
),
),
);

The pipeFrom helper was deleted outright (libraries/stream-extra/src/pipe-from.ts,
28 lines removed) and replaced by DelayedCloseWritableStream, a new
78-line class in libraries/stream-extra/src/delayed-close-writable.ts.

The name tells you the bug. pipeFrom starts the source pump eagerly and
returns a writable that writes into it. Nothing in that shape guarantees the
pump has drained before the writable is closed. The ADB sync service’s
sendV1 — the v1 push protocol that adb push uses — writes a DONE
request and then closes the stream, and the server’s OKAY response arrives
after that. With pipeFrom, writer.close() could resolve before the
final OKAY was ever read, so push would report success for a transfer
that the device had not actually acknowledged.

DelayedCloseWritableStream closes that hole by taking the pump promise
explicitly and making close() wait for both:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
async close() {
const [closeResult, promiseResult] = await Promise.allSettled([
writer.close(),
promise,
]);
if (closeResult.status === "rejected") {
if (
promiseResult.status === "rejected" &&
// Ignore promise rejection if the reason is known
promiseResult.reason !== closeResult.reason &&
typeof AggregateError !== "undefined"
) {
throw new AggregateError([
closeResult.reason,
promiseResult.reason,
]);
}
throw closeResult.reason;
}
if (promiseResult.status === "rejected") {
throw promiseResult.reason;
}
}

The reason !== closeResult.reason check is the subtle part: when the pump
fails for the same reason the close failed, that is one error, not two, and
throwing an AggregateError over it would obscure the actual cause. When
they differ, you genuinely have two failures and AggregateError is right.
The same discrimination appears in abort().

There is also a second, quieter fix in the same class — the same
void promise.catch(() => {}) idiom that
yesterday’s post
covered for Consumable.WritableStream.write:

1
2
3
// Suppress unhandled promise warning when
// the promise is never awaited
void promise.catch(() => {});

It is not a coincidence that the same pattern shows up in two places in the
same library within three weeks. DelayedCloseWritableStream was written in
September; Consumable.WritableStream.write got the same treatment in the
open PR #878 on
November 2. The library author is converging on “attach the handler eagerly”
as the house style for promise pairs where one failing implies the other.

The credential store was rewritten around real IndexedDB semantics

PR #871, “fix(credential-web):
fix IndexedDB usage”
, landed 2026-10-02 as 7eaade3c — the fix for
issue #870, where
TangoIndexedDbStorage.load() always threw “callback must not be an async
function”
.

The root cause is a genuinely nasty IndexedDB rule: an IDBTransaction
auto-commits the moment the microtask queue drains. If you await anything
non-IndexedDB inside a transaction callback — even a resolved promise — the
transaction is already inactive by the time your next store.get() runs, and
you get TransactionInactiveError. The fix is to do all the database work
synchronously inside the transaction callback and await the request, never
the transaction.

The new libraries/adb-credential-web/src/storage/indexed-db/shared.ts
is built around three helpers — openDatabase, createTransaction, and
waitRequest — and the diff is 181 lines. waitRequest explicitly refuses
to work inside a transaction:

1
2
3
4
5
6
7
8
9
10
11
12
13
it("should throw if used inside a transaction", async () => {
const db = await openDatabase(nextDatabaseName(), 1, (db) => {
db.createObjectStore("store", { autoIncrement: true });
});
const tx = db.transaction("store", "readwrite");
const store = tx.objectStore("store");
const request = store.put({ value: 1 });
await assert.rejects(
() => waitRequest(request),
/Cannot wait for a request inside a transaction/,
);
db.close();
});

and createTransaction refuses async generators outright:

1
2
3
4
5
6
7
8
9
it("should reject async generators", async () => {
await assert.rejects(
// @ts-expect-error unit test
createTransaction(db, "store", async function* () {
yield new Promise((resolve) => setTimeout(resolve, 0));
}),
/Async generators are not supported/,
);
});

Both rules are the same rule viewed from two directions: the transaction’s
lifetime is bounded by the synchronous execution of its callback, and any
await that yields to the event loop ends it.

Two supporting changes ship alongside it. First, AdbWebCryptoCredentialManager
gains a close() method that forwards to the storage’s optional close(),
so the underlying IndexedDB connection can be released — previously there was
no way to close it at all. Second, the fix comes with a real test suite:
libraries/adb-credential-web/src/storage/indexed-db/shared.spec.ts,
272 lines, running against fake-indexeddb. The fake-indexeddb package
plus node:test is how the library tests IndexedDB behaviour at all, and it
is why these bugs are now caught before shipping rather than in a user’s
browser.

Where webadb.online actually stands

Here is the part that matters for us.

1
2
3
4
5
$ grep -o '"version": *"[^"]*"' node_modules/@yume-chan/*/package.json
@yume-chan/adb installed: "3.0.0-beta.1"
@yume-chan/adb-credential-web installed: "3.0.0-beta.1"
@yume-chan/adb-daemon-webusb installed: "3.0.0-beta.1"
@yume-chan/stream-extra installed: "3.0.0-beta.1"

All four of our @yume-chan/* dependencies are pinned three beta releases
behind what is on npm. npm view @yume-chan/adb dist-tags reports
latest: 2.6.4, beta: 3.0.0-beta.4, with 3.0.0-beta.4 published
2026-10-09.

The gap is not cosmetic. Concretely:

  • Our device transport still uses the pipeFrom-based writable path, so
    an adb push through the File Manager panel can in principle resolve
    before the device acknowledges the transfer. The push.spec.ts tests
    added in beta.3 assert exactly this ordering:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    const closedBeforeResponse = closed;

    response.enqueue(
    Socket.NumberRequest.serialize({
    id: ResponseId.Ok,
    arg: 0,
    }),
    );
    await closePromise;

    assert.strictEqual(closedBeforeResponse, false);
    That assertion — closedBeforeResponse === false — is the test that would
    fail on beta.1.
  • Our disconnect handling still pays the 100 ms heuristic penalty. Our
    lib/adb-client.ts watchDisconnect listens for the navigator.usb
    "disconnect" event and races it against transport.disconnected. The
    upstream read loop, on beta.1, sleeps 100 ms on every ambiguous
    NetworkError before it can tell you the phone is gone. On beta.4 with
    a current Chrome, it would know immediately.
  • We do not use TangoIndexedDbStorage, so the IndexedDB rewrite is not
    directly a problem for us. We use TangoLocalStorage — new AdbWebCryptoCredentialManager(new TangoLocalStorage(ADB_KEY_STORAGE_KEY))
    at lib/adb-client.ts:88 — which stores the RSA key as base64 PKCS#8 in
    localStorage and sidesteps IndexedDB’s transaction-lifetime rules
    entirely. That was a deliberate choice when we moved to the 3.0 beta line
    and it remains the right one for us. The close() addition to
    AdbWebCryptoCredentialManager is still worth having: it gives us a
    deterministic teardown path for the credential manager when a session
    ends, rather than leaving it to garbage collection.

There is one more consequence of the upgrade that is not a bug fix at all.
beta.4 includes d8d1ddc8 — “feat(scrcpy): add version 5.0 and 5.0.1 as
aliases”
— which adds scrcpy 5.0 and 5.0.1 to the server-version alias
table. scrcpy 5.0 shipped on 2026-10-05 and 5.0.1 on 2026-10-08. Our
Screencast panel does not use the scrcpy server at all — it uses the
file-based adb shell screenrecord polling pipeline — but the alias table
is the library’s canonical list of known scrcpy server versions, and it is
worth knowing the library now speaks for a scrcpy generation that postdates
our own implementation choices.

Why the Chrome 157 timing makes this worth doing now

Chrome 157 rolled out to stable on November 3 and will reach users “over the
coming days/weeks” — the same rollout pattern as every Chrome release, but
it means the NotFoundError disconnect behaviour is now in the hands of the
general public rather than sitting behind a flag on a developer build.

That matters for a specific reason. The NotFoundError path in
AdbDaemonWebUsbConnection is a fast path: it returns immediately. The
NetworkError path is a slow path: it waits 100 ms, and if the connection
was closed in the meantime, it reports a clean disconnect. On a browser that
has not shipped the change, our code takes the slow path and the extra 100 ms
shows up as a small but real lag between “I yanked the cable” and “the UI
says the device is gone”.

Once Chrome 157 is the dominant stable build, the fast path is the default
and the heuristic becomes a fallback for older browsers rather than the
primary mechanism. Upgrading to beta.4 is what lets us take that path.

There is a broader point about the shape of these dependencies. ya-webadb is
pre-1.0 and its betas move fast: three releases in ten weeks, each carrying
behavioural changes to the transport layer that we consume. Our package.json
says ^3.0.0-beta.1, and npm’s caret semantics on a prerelease tag do not
mean “upgrade to any later beta” — they resolve to exactly what is installed
here, 3.0.0-beta.1, and stay there. Upgrading is a deliberate act, not an
automatic one, and it should be.

What this means for webadb.online

Directly relevant, and there is a concrete action item.

We are running 3.0.0-beta.1 of the ADB library stack while 3.0.0-beta.4
has been on npm since October 9. The two changes in that window that affect
us are the DelayedCloseWritableStream rewrite of the WebUSB writable path
(the adb push acknowledgement ordering) and the NotFoundError handling in
the read loop (the disconnect fast path). Both are the kind of change that is
invisible when it works and produces a confusing bug report when it does
not — a file upload that silently reports success, or a device that lingers
in “connected” state for a beat after you unplug it.

Our plan is to bump all four @yume-chan/* dependencies to 3.0.0-beta.4,
verify the File Manager upload path and the connect/disconnect cycle in the
browser against a real device, and confirm the push.spec.ts ordering
assertion holds on our transport. The TangoLocalStorage credential path is
unaffected, since beta.4‘s IndexedDB rewrite only touches
TangoIndexedDbStorage, which we do not use.

Beyond that, Chrome 157 is a good excuse to re-check our platform
assumptions in one place. Our _headers file already sets COOP/COEP/CORP
because ya-webadb’s SharedArrayBuffer usage requires cross-origin
isolation, and the toLocalUint8Array copy in the transfer path exists
because “WebUSB doesn’t support SharedArrayBuffer”
(whatwg/usb#243). Chrome 157
did not change any of that. But the release is a reasonable checkpoint for
re-reading the WebUSB spec draft (5 June 2026) against what Chromium
actually does — because as of kvnloo‘s comment on
whatwg/usb#219,
the two have already diverged on disconnect semantics, and the spec is the
one that is behind.

One note on process: the Chromium Direct Sockets check that runs on Mondays
is skipped this week — today is Wednesday, and that source is weekly by
design.

Chromium plumbs permissions policy into shared workers

Chrome’s PermissionsPolicyForSharedWorkers feature landed a five-CL series
into refs/heads/main between 2026-09-30 and 2026-10-28, giving shared
workers an allow attribute that carries a parsed permissions policy into the
worker’s global scope. That is the missing half of the “Direct Sockets API in
Shared/Service workers” entry on chromestatus, which has sat at Proposed
with no milestone since 2025-01-31.

It is also, incidentally, the reason this week’s check turned up something
stranger: the chromestatus entry
6046077976444928,
“Permission Policy Merger: direct-sockets-private with local-network and
loopback-network“, is still describing a permission policy that Chromium
deleted outright four months ago. It says Proposed, milestone 151, and it
describes a “default unpacking” model that no longer exists in the tree.

Both facts are worth writing down carefully, because the gap between what the
status page says and what the tree does is exactly the kind of thing that
sends an implementer down the wrong path.

The chromestatus entry that outlived its implementation

The entry’s summary reads:

Isolated Web App manifests now require specific “local-network” and/or
“loopback-network” permission policies to enable Direct Sockets connections
to local or loopback network addresses, respectively. This change replaces the
existing “direct-sockets-private” permission policy.

Its stage table still lists a milestone-151 stage, and its browsers.chrome
block still says:

1
2
3
4
"status": { "text": "Proposed", "val": 2, "milestone_str": "Proposed" },
"desktop": 151,
"origintrial": false,
"announced": true

The updated field on that entry is 2026-06-22 13:32:10, by
bhaskarsharma@google.com. That is the last time anyone touched it.

Now the tree. Chromium commit
f1b445b81bac
— “Remove direct-sockets-private permission policy”, 2026-06-12 — did
substantially more than delete a policy name:

1
2
3
4
5
6
7
Bug: 492476083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7845254
Reviewed-by: Vlad Krot <vkrot@google.com>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Andrew Rayskiy <greengrape@google.com>
Cr-Commit-Position: refs/heads/main@{#1646037}

Its commit message is one sentence, and it is the important sentence:

This CL removes “direct-sockets-private” permission policy along with its
default unpacking to “local-network” and “loopback-network” permission
policies.

Note the shape of that sentence. “Direct Sockets private” was not renamed to
the pair, and it was not unpacked into the pair at runtime any more — it was
removed, and with it went the unpacking behavior. The two granular policies
now stand on their own.

The diff shows the scale of it. kDirectSocketsPrivate disappears from
services/network/public/mojom/permissions_policy.mojom, where the enum value
is not deleted but reserved:

1
2
3
4
5
6
7
8
9
message IwaAccessControl {
CONTROLLED_FRAME = 1;
DIRECT_SOCKETS = 2;
DIRECT_SOCKETS_MULTICAST = 3;
reserved 4;
SMART_CARD = 5;
SUB_APPS = 6;
UNRESTRICTED_WEBUSB = 7;
}

reserved 4 is the protobuf idiom for “this number was used, do not reuse
it.” The value that was DIRECT_SOCKETS_PRIVATE = 4 is now a hole. The same
pattern shows up in the IWA entitlement proto:

1
2
3
4
5
6
7
8
constexpr std::string_view kEntitledFeatures[] = {
"direct-sockets", "direct-sockets-multicast",
"sub-apps", "usb-unrestricted",
"web-printing", "controlled-frame",
#if defined(ENABLE_SMART_CARD)
"smart-card",
#endif
};

"direct-sockets-private" is gone from the entitled-features list. The
IwaEntitlementProto::DIRECT_SOCKETS_PRIVATE enum value is gone from
key_distribution.proto, and the corresponding entitlement line is gone from
key_distribution.textproto — the file that ships the allowlist to ChromeOS
kiosk deployments.

The browser-side enforcement path

The interesting part for anyone reading the tree today is in
content/browser/direct_sockets/direct_sockets_service_impl.cc. Before the
removal, the private-network access request path looked like this:

1
2
3
4
5
6
7
8
9
10
if (!rfh->IsFeatureEnabled(
network::mojom::PermissionsPolicyFeature::
kDirectSocketsPrivate)) {
std::move(callback).Run(/*access_allowed=*/false);
return;
}

rfh->GetBrowserContext()
->GetPermissionController()
->RequestPermissionsFromCurrentDocument(...)

After, that whole first block is gone. The kDirectSocketsPrivate gate is
not replaced by a kLocalNetwork / kLoopbackNetwork gate in that function
— the permission check moved elsewhere, to the policy-controlled-feature
machinery that local-network and loopback-network already participate in
as ordinary policies.

This is the part that trips people up when they read the chromestatus entry
and then try to find the corresponding code. The “merger” the entry describes
is not a merger in the current tree; it is a removal, and the granular
policies were already there.

What the removal meant in practice

The browsertest diffs are the clearest record of the behavior change, because
the policy declarations are explicit in them. Before:

1
2
3
.WithPermissionsPolicy("direct-sockets", "(self)")
.WithPermissionsPolicy("direct-sockets-private", "(self)")
.WithPermissionsPolicy("direct-sockets-multicast", "(self)")

After:

1
2
3
4
.WithPermissionsPolicy("direct-sockets", "(self)")
.WithPermissionsPolicy("local-network", "(self)")
.WithPermissionsPolicy("loopback-network", "(self)")
.WithPermissionsPolicy("direct-sockets-multicast", "(self)")

Note that both granular policies are now declared. local-network covers
RFC 1918 address space; loopback-network covers 127.0.0.0/8 and ::1.
An app that wants a Direct Sockets connection to a LAN device needs the first;
one that wants to talk to a server on the same machine needs the second.

And the merge-time “unpacking” behavior is gone from the test suite too. The
commit deletes a whole test class from
chrome/browser/web_applications/isolated_web_apps/isolated_web_app_permissions_policy_browsertest.cc:

1
2
3
4
5
6
7
8
9
10
11
12
-class IsolatedWebAppDirectSocketsPrivatePermissionsPolicyUnpackingTest
- : public web_app::IsolatedWebAppBrowserTestHarness {
- public:
- content::RenderFrameHost* InstallAndOpenIWAWithFeatures(
- std::map<network::mojom::PermissionsPolicyFeature,
- std::vector<url::Origin>> feature_map = {}) {
- auto builder =
- ManifestBuilder(
- /*include_cross_origin_isolated_permissions_policy=*/true)
- .AddPermissionsPolicyWildcard(
- network::mojom::PermissionsPolicyFeature::kDirectSockets);
...

143 lines of test, all of it testing the unpacking. It is gone. If you go
looking for that behavior to understand how direct-sockets-private used to
work, the answer is that it does not work — the mechanism was removed along
with the policy.

Why the entry was never updated

The plausible explanation is that the removal was framed as a cleanup rather
than a feature change. The CL description says “removes … along with its
default unpacking” — that is a correctness framing, because the unpacking
was doing something surprising. But the chromestatus entry
6046077976444928 is
still the entry a developer lands on when they search “Direct Sockets” and
want to know what manifest permissions to write. Its updated timestamp is
ten days before the commit that invalidated it, and its last edit was
2026-06-22 — ten days after. So the entry was already being maintained
after the removal, and still describes the old model.

For our own project this has a concrete consequence: any note we write about
“the merger” is describing a mechanism that no longer exists in the tree, and
any manifest we write should declare local-network and loopback-network
directly rather than expecting a direct-sockets-private declaration to be
unpacked into them.

The PermissionsPolicyForSharedWorkers series

Now the genuinely new work. The chromestatus entry
5169039028256768,
“Direct Sockets API in Shared/Service workers”, reads:

Allows Isolated Web Apps to establish direct transmission control protocol
(TCP) and user datagram protocol (UDP) communications with network devices
and systems as well as listen to and accept incoming connections from shared
/service workers.

The Direct Sockets API has been launched in Chrome 131 for window & dedicated
worker contexts; this separate entry aims at expanding these to accommodate
shared / service workers to achieve parity with the exposure of other
networking capabilities such…

Its Chrome status block:

1
2
3
"status": { "text": "Proposed", "val": 2, "milestone_str": "Proposed" },
"desktop": null,
"announced": false

No milestone. Not announced. Created 2025-01-31, and the entry’s updated
field has not moved since 2025-02-12.

That entry is not going to move on its own. What is moving is the
permissions-policy plumbing that a shared-worker Direct Sockets
implementation would need — because a shared worker that can open raw TCP
sockets is exactly the kind of thing that needs a policy to constrain it, and
Chromium had no way to express a per-worker policy at all.

The five CLs

Tracking bug 562705553. All five land on refs/heads/main:

Commit Date Subject
8c2c2dfb5fb2 2026-09-30 Add feature and define allow parameter
c40fd2ef2dec 2026-10-20 Parse SharedWorkerOptions.allow
3aa2f4ff7f9e 2026-10-20 Check allow against creator
c40dcca70c04 2026-10-20 Plumb to shared worker host
1c9716f07802 2026-10-21 Send down to SharedWorkerGlobalScope
e8113630b3fd 2026-10-28 Ensure consistency of feature flags

(The first CL is from 2026-09-30; the last is from four days ago. The series
was reviewed by Yoshisato Yanagisawa, Daniel Vogelheim, Hiroshige Hayashizaki,
Camille Lamy, Antonio Sartori, Mike West, and Reilly Grant.)

CL 1 — the feature and the IDL

8c2c2dfb5fb2
adds the runtime-enabled feature and the optional IDL member:

Define the PermissionsPolicyForSharedWorkers runtime-enabled feature with
experimental status and enable it with
–enable-experimental-web-platform-features in the browser process.

Add the optional allow DOMString member to the SharedWorkerOptions IDL
dictionary behind PermissionsPolicyForSharedWorkers, making it available to
the SharedWorker constructors.

Three files touched:

1
2
3
content/public/common/content_switch_dependent_feature_overrides.cc (+3/-0)
third_party/blink/renderer/core/workers/shared_worker.idl (+1/-0)
third_party/blink/renderer/platform/runtime_enabled_features.json5 (+4/-0)

The shared_worker.idl change is the whole API surface of this CL — one
optional DOMString allow member on the SharedWorkerOptions dictionary:

1
2
3
4
5
dictionary SharedWorkerOptions {
DOMString name;
DOMString type;
sequence<USVString> credentials;
};

becomes:

1
2
3
4
5
6
dictionary SharedWorkerOptions {
DOMString name;
DOMString type;
sequence<USVString> credentials;
DOMString allow;
};

This mirrors the WorkerOptions shape that the HTML standard specifies for
dedicated workers. A dedicated worker gets its allow list from the
WorkerOptions dictionary; a shared worker gets its own, because a shared
worker is instantiated by many documents and the policy has to be agreed
upon by all of them.

CL 2 — parsing the attribute

c40fd2ef2dec
wires the parser in:

Parse the allow attribute on SharedWorkerOptions using
PermissionsPolicyParser::ParseAttribute() in SharedWorker::CreateImpl() when
PermissionsPolicyForSharedWorkers is enabled, and log any parser messages to
the execution context console.

The relevant part of the diff is in shared_worker.cc — a PermissionsPolicyParser
is constructed, ParseAttribute() is called with the allow string, and the
resulting feature list is checked.

The parser gains two new entry points:

1
2
3
4
5
6
7
third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc (+29/-0)
third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.h (+10/-0)
third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc (+61/-0)
third_party/blink/renderer/core/workers/build.gni (+1/-0)
third_party/blink/renderer/core/workers/shared_worker.cc (+35/-0)
third_party/blink/renderer/core/workers/shared_worker.h (+8/-0)
third_party/blink/renderer/core/workers/shared_worker_test.cc (+68/-0)

CL 3 — the delegation check

3aa2f4ff7f9e
is the security-relevant one:

Verify in SharedWorker::CreateImpl() that the creator ExecutionContext can
delegate to the worker origin every feature parsed from
SharedWorkerOptions.allow, and trigger Sharedworker.onerror otherwise.

This is the same rule that applies to WorkerOptions.allow in a dedicated
worker: the creator document may only delegate features it itself holds. A
page that does not have direct-sockets cannot create a shared worker that
has direct-sockets. If it tries, the construction fails and
Sharedworker.onerror fires.

The delegation machinery itself is added to the network service’s policy
code:

1
2
3
4
5
6
7
services/network/public/cpp/permissions_policy/permissions_policy.cc (+10/-0)
services/network/public/cpp/permissions_policy/permissions_policy.h (+12/-0)
services/network/public/cpp/permissions_policy/permissions_policy_unittest.cc (+66/-0)
third_party/blink/renderer/core/permissions_policy/permissions_policy_parser.cc (+2/-8)
third_party/blink/renderer/core/workers/shared_worker.cc (+38/-5)
third_party/blink/renderer/core/workers/shared_worker.h (+7/-3)
third_party/blink/renderer/core/workers/shared_worker_test.cc (+162/-10)

CL 4 — across the process boundary

c40dcca70c04
pushes the parsed policy from the renderer into the browser process:

This CL adds permissions_policy as a parameter to
blink.mojom.SharedWorkerInfo(), forwards the parsed permissions policy in
the ‘allow’ attribute from SharedWorker::Create() to the browser process and
validates browser-side whether the policy is allowed.

This is the CL that adds the mojom plumbing:

1
2
3
4
5
6
third_party/blink/public/mojom/worker/shared_worker_info.mojom (+5/-0)
services/network/public/mojom/permissions_policy/permissions_policy.mojom (+6/-0)
services/network/public/mojom/permissions_policy/permissions_policy_mojom_traits.cc (+8/-0)
services/network/public/mojom/permissions_policy/permissions_policy_mojom_traits.h (+15/-0)
content/browser/worker_host/shared_worker_service_impl.cc (+25/-0)
content/browser/worker_host/shared_worker_host.cc (+5/-1)

And it is the CL that adds the browser-side half of the delegation check —
permissions_policy.cc and permissions_policy.h each grow a dozen lines,
and permissions_policy_mojom_traits.h grows fifteen.

CL 5 — into the worker’s global scope

1c9716f07802
finally stores it where the worker can consult it:

Pass the worker’s parsed permissions policy in the SharedWorkerInfo sent via
SharedWorkerFactory::CreateSharedWorker(), plumb it to
WebSharedWorkerImpl::StartWorkerContext() and store it in the SecurityContext
of the newly created WorkerGlobalScope.

The diff in web_shared_worker_impl.cc is where the policy actually gets
applied:

1
2
3
4
5
6
7
8
9
10
11
12
if (RuntimeEnabledFeatures::PermissionsPolicyForSharedWorkersEnabled()) {
const url::Origin worker_origin =
(creation_params->origin_to_use
? creation_params->origin_to_use.get()
: outside_settings_object->GetSecurityOrigin())
->ToUrlOrigin();
creation_params->worker_permissions_policy =
network::PermissionsPolicy::CreateFromInheritedPolicy(
// TODO(https://crbug.com/562705553): Parse the Permissions-Policy
// header and take header_policy into account.
permissions_policy, /*header_policy=*/{}, worker_origin);
}

Two things worth noticing in that snippet.

First, CreateFromInheritedPolicy is a new factory method added by this
CL, sitting next to the existing CreateFromParsedPolicy:

1
2
3
4
5
6
7
8
9
// static
std::unique_ptr<PermissionsPolicy> PermissionsPolicy::CreateFromInheritedPolicy(
const network::PermissionsPolicyFeaturesBitset& inherited_policies,
const network::ParsedPermissionsPolicy& header_policy,
const url::Origin& origin) {
return base::WrapUnique(new PermissionsPolicy(
origin, CreateAllowlistsAndReportingEndpoints(header_policy),
inherited_policies, network::GetPermissionsPolicyFeatureList(origin)));
}

Second, the TODO is honest about a gap: the Permissions-Policy response
header
is not parsed yet — only the allow attribute is. The
/*header_policy=*/{} argument is an empty parsed policy. That is a real
limitation of the current implementation, not a documentation nicety.

The same CL also removes a TODO that had been sitting in
content/browser/worker_host/shared_worker_host.cc — the one that said the
permissions policy was not yet stored on the SharedWorkerInstance and sent
down to the renderer:

1
2
3
4
5
-      // TODO(https://crbug.com/562705553): Store the shared worker's
- // permissions policy on the SharedWorkerInstance and send it down to the
- // renderer process.
- network::PermissionsPolicyFeaturesBitset()));
+ instance_.permissions_policy()));

CL 6 — flag consistency

e8113630b3fd,
four days ago, is the one that makes the previous CLs safe to actually enable:

This CL ensures that the runtime enabled flag
PermissionsPolicyForSharedWorkers in blink can only be enabled in
conjunction with the counterpart blink feature. That is necessary because
part of the functionality is implemented in the browser process.

The problem it solves: Blink has a runtime-enabled feature
(RuntimeEnabledFeatures::PermissionsPolicyForSharedWorkersEnabled(), used
above in web_shared_worker_impl.cc), and the browser process has a
base::Feature (blink::features::kPermissionsPolicyForSharedWorkers).
If only one of the two is on, the renderer will consult a policy that the
browser never validated. So content/child/runtime_features.cc now resolves
the mismatch at startup:

1
2
3
4
5
6
7
8
9
10
11
if (!base::FeatureList::IsEnabled(
blink::features::kPermissionsPolicyForSharedWorkers)) {
LOG_IF(WARNING,
WebRuntimeFeatures::IsPermissionsPolicyForSharedWorkersEnabled())
<< "PermissionsPolicyForSharedWorkers cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kPermissionsPolicyForSharedWorkers.name
<< " instead.";
WebRuntimeFeatures::EnablePermissionsPolicyForSharedWorkers(false);
}

And runtime_enabled_features.json5 gains one line to match:

1
2
3
4
5
{
name: "PermissionsPolicyForSharedWorkers",
status: "experimental",
public: true,
},

public: true means the Blink-side runtime feature is exposed to JS as
self.PermissionsPolicyForSharedWorkers, so a page can feature-detect it
instead of guessing.

Why this is the Direct Sockets prerequisite

The connection to Direct Sockets is not speculative. The chromestatus entry
for workers-scoped Direct Sockets is Proposed with no milestone, but the
Chromium flags that gate it were explicitly extended last month.

Commit 7dba2c9e4dc0,
2026-05-08, “Extend the direct-sockets-in--worker flags”*:

This commit extends the direct-sockets-in-shared-workers and
direct-sockets-in-service-workers feature flag to M170. The feature is not
launched yet.

The diff is in chrome/browser/flag-metadata.json, and it is only about
expiry dates:

1
2
3
4
5
6
7
8
9
10
11
12
{
"name": "direct-sockets-in-service-workers",
"owners": [ "//content/browser/direct_sockets/OWNERS" ],
- "expiry_milestone": 150
+ "expiry_milestone": 170
},
{
"name": "direct-sockets-in-shared-workers",
"owners": [ "//content/browser/direct_sockets/OWNERS" ],
- "expiry_milestone": 150
+ "expiry_milestone": 170
},

Both flags now expire at milestone 170 — roughly a year of runway past where
they were, and a clear signal that Chromium intends to launch the feature
before then.

The history of those flags is worth a short walk, because it shows the shape
of the problem:

  • cea39453dc19 (2025-02-11) — “Add #direct-sockets-in-service-workers flag to about://flags”
  • f807b7164793 (2025-02-10) — “DirectSockets: support shared workers on the browser side”
  • 3f3a3797878f (2025-02-06) — “DirectSockets: Add Shared/Service workers to .idl defs behind flags”
  • b4d6430bfe1d (2025-04-07) — “[DirectSockets] Relax the CrossOriginCapability requirement for workers”
  • 2bba61b431f3 (2026-04-01) — “[Direct Sockets] Implement dynamic enablement in Isolated Contexts”

The browser side of worker-scoped Direct Sockets has been in the tree for
about twenty-one months. What it did not have, until this series, was a
permissions-policy mechanism to constrain what a shared worker may do. A
shared worker opened by many documents needs an agreed policy, and there was
no way to express one.

That is exactly what PermissionsPolicyForSharedWorkers adds. The
allow attribute on SharedWorkerOptions is the standard HTML shape for
“this worker gets these features, and every creator must be able to delegate
them.”

The allow list is a list of feature names — and the feature names for
Direct Sockets are direct-sockets, direct-sockets-multicast,
local-network, and loopback-network. A shared worker that wants to open a
TCP socket to a LAN address would need:

1
2
3
4
const worker = new SharedWorker("worker.js", {
name: "adb",
allow: "direct-sockets local-network loopback-network",
});

That is the shape the Chromium implementation now supports.

The state of the board

Pulling it together, here is where each piece stands as of 2026-11-02:

Entry chromestatus status Tree reality
direct-sockets (core API) Enabled by default, 131 shipped
Source-Specific Multicast Enabled by default, 158 shipped (030237772913, 863435829ee0)
direct-sockets-private merger Proposed, 151 removed 2026-06-12 (f1b445b81bac)
Direct Sockets in Shared/Service workers Proposed, no milestone browser side shipped 2025-02; flags extended to M170 2026-05-08; permissions-policy plumbing landed 2026-09-30 → 2026-10-28
WebRequest.SecurityInfo in Controlled Frame Proposed, 145 unchanged since 2026-01-27

Two rows in that table are stale, and they are stale in opposite directions.
The merger entry overstates a change that was reverted into a plain removal.
The worker entry understates work that has been landing in the tree for
five weeks.

Neither is a problem for webadb.online today — we use WebUSB, not Direct
Sockets, in the shipped product. But lib/adb-daemon-tcp.ts implements the
wireless-ADB-over-TCP transport on top of navigator.openTCPSocket(), and
that file’s comments are written against the old mental model:

1
2
3
4
5
6
7
8
9
// Browser requirements:
// - Chrome 142+ (we tested 150.0.7871.114)
// - One of:
// * Origin Trial token for "Direct Sockets API" (added to the page)
// * chrome://flags/#enable-experimental-web-platform-features enabled
// * Enterprise policy allow-list
// - The page must be served over HTTPS (webadb.online is) and must already
// pass the crossOriginIsolated check (webadb does). Direct Sockets
// requires `crossOriginIsolated === true` to even be visible.

The “Origin Trial token” line is stale in a different way: the Direct Sockets
API shipped enabled-by-default in Chrome 131 for window and dedicated worker
contexts, so there is no origin trial to enroll in for the main use case. The
local-network / loopback-network policies are the current gating
mechanism, not direct-sockets-private. And the “Chrome 142+” floor is
conservative — the API has been on by default since 131.

What this means for webadb.online

No impact on the shipped product this week. The Direct Sockets transport in
lib/adb-daemon-tcp.ts remains an experimental Wi-Fi-ADB path behind a
browser capability probe, and nothing that landed in the last seven days
changes the transport’s availability on a normal page.

Two things are worth watching, though.

The first is that the PermissionsPolicyForSharedWorkers series is the first
concrete movement in the worker-scoped Direct Sockets path in months. If the
direct-sockets-in-shared-workers flag is launched before M170, the natural
shape for a browser ADB client is a shared worker owning a persistent TCP
connection to the device’s wireless-debug port, with the main thread talking
to it over a MessagePort. That would move the TCP framing off the UI
thread entirely. The flag expiry bump to M170 is the visible signal that
launch is planned; the permission-policy plumbing is the first blocker
cleared.

The second is the chromestatus merger entry. If we ever document the
Direct Sockets requirements for the wireless-ADB transport, we should
describe local-network and loopback-network as the policies to declare —
not direct-sockets-private, and not a “merger” that unpacks one into the
other. Chromium removed that mechanism on 2026-06-12. The status page is
still telling people to write a policy name that no longer exists.

Upstream ya-webadb had no new commits in the last 24 hours — the most recent
are 59e95a0 and 93fce38 from 2026-10-30, both covering the PCM player’s
AudioContext resume, which the 2026-10-31
post

already documented. The v3.0.0-beta.4 tag from 2026-10-09 remains the
newest release.

ya-webadb's Consumable writable path leaks an unhandled rejection

On 2026-11-02, Qingyu Wang (colinaaa) filed
yume-chan/ya-webadb#876
with a minimal reproduction that crashes Node.js even when the caller wraps
the write in try / catch. The bug lives in
@yume-chan/stream-extra‘s ConsumableWritableStream.write — the exact
helper that AdbDaemonDispatcher.sendPacket and the ADB auth handshake call
on every single packet. By the end of the day the fix had been proposed,
reviewed, rejected, and re-proposed; the surviving version is
#878, currently open, one
line of production code and 67 lines of regression test.

What makes this worth writing about is not the bug. It is the shape of the
review that killed the first fix — because the “obvious” repair, the one the
issue author proposed and most reviewers would have approved, silently
breaks error precedence in a way that is invisible until you read the diff
twice.

The bug: a promise with no handler attached before control flow exits

Consumable is ya-webadb’s backpressure primitive. It wraps a value in an
object carrying a consumed promise; the producer resolves or rejects that
promise when the downstream sink actually finishes handling the chunk. The
whole point is to let a writer know that its bytes were really consumed
rather than merely buffered.

ConsumableWritableStream is the writable half. Its write sink delegates
to chunk.tryConsume:

1
2
3
4
5
write(chunk, controller) {
return chunk.tryConsume((chunk) =>
sink.write?.(chunk, controller),
);
}

and Consumable.prototype.tryConsume in
libraries/stream-extra/src/consumable.ts does this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
tryConsume<U>(callback: (value: T) => U) {
try {
let result = this.#task.run(() => callback(this.value));
if (isPromiseLike(result)) {
result = result.then(
(value) => {
this.#resolver.resolve();
return value;
},
(e) => {
this.#resolver.reject(e);
throw e;
},
) as U;
} else {
this.#resolver.resolve();
}
return result;
} catch (e) {
this.#resolver.reject(e);
throw e;
}
}

Read that rejection branch carefully: when the sink’s write callback
rejects, tryConsume does two things with the same error e. It calls
this.#resolver.reject(e), which rejects the consumed promise hanging off
the Consumable. And then it rethrows e, which rejects the promise
returned by writer.write(consumable).

Two rejections, one error. That is deliberate — the sink failed, so both the
“did you consume it” signal and the “did the write succeed” signal must
reject — but it creates the hazard.

The static helper that most callers actually use was, on main as of
59e95a0e, this:

1
2
3
4
5
6
7
8
static async write<T>(
writer: WritableStreamDefaultWriter<Consumable<T>>,
value: T,
) {
const consumable = new Consumable(value);
await writer.write(consumable);
await consumable.consumed;
}

Note the ordering. await writer.write(consumable) comes first. If the sink
rejects, that await throws, and control flow leaves the function before
await consumable.consumed is ever reached. The consumed promise was
rejected by tryConsume at that same moment, but nobody has attached a
rejection handler to it. In a browser that means a console warning. In
Node.js, where an unhandled rejection terminates the process by default, it
means the process dies — even though the caller did exactly what they were
supposed to:

1
2
3
4
5
6
try {
await Consumable.WritableStream.write(writer, new Uint8Array([1, 2, 3]));
} catch (e) {
console.log("Caught expected write error:", e.message);
}
// Node.js still crashes with UnhandledPromiseRejection

The irony is sharp: the try / catch around the call is what makes the code
look correct, and it is precisely the catch that means the caller never
sees the second rejection. The catch handles one of the two rejections and
leaves the other to the runtime.

Why this matters for ADB specifically

Consumable.WritableStream.write is not an exotic corner of the library.
It is on the hot path for every ADB packet:

  • libraries/adb/src/daemon/dispatcher.ts:458 — sendPacket, which every
    command (shell, sync, reverse, forward, …) funnels through.
  • libraries/adb/src/daemon/auth/authenticator.ts:62 — sendPacket during
    the authentication handshake.
  • libraries/adb/src/service/sync/socket.ts:116 — the sync service.

So the trigger condition is not exotic either: the device goes away
mid-write
. A phone that sleeps, a USB cable that gets nudged, a wireless
debugging session that times out, an adb kill-server racing an in-flight
command. In every one of those cases the socket write fails, the sink
rejects, and tryConsume rejects both consumed and writer.write.

The issue text names the scrcpy case explicitly:

any write error on a Consumable.WritableStream or
MaybeConsumable.WritableStream (for example, writing through
ScrcpyControlMessageWriter after the underlying socket has been closed by
the remote peer) crashes the process with unhandledRejection even if the
caller wraps write() in try / catch or attaches .catch().

The first fix, and why it was wrong

The issue author proposed what looks like the textbook repair: await both
promises concurrently, so both rejection handlers get attached in the same
tick.

1
2
3
4
5
6
7
static async write<T>(
writer: WritableStreamDefaultWriter<Consumable<T>>,
value: T,
) {
const consumable = new Consumable(value);
await Promise.all([writer.write(consumable), consumable.consumed]);
}

That is PR #877, opened
2026-11-02 10:56 UTC with commit 79424b60.

It does fix the unhandled rejection. Promise.all attaches handlers to both
promises synchronously, so neither rejection is ever orphaned. But it breaks
something else, and CodeRabbit’s review bot caught it on the inline comment
at libraries/stream-extra/src/consumable/writable.ts:29:

Preserve write completion and error precedence. Update the helper
containing writer.write and consumable.consumed to attach a rejection
handler to consumable.consumed immediately, then await writer.write
before awaiting consumable.consumed. Preserve write completion and ensure
a write rejection takes precedence over an earlier consumed rejection.

The problem with Promise.all is that it resolves on first rejection but
attaches handlers to both, so the error that surfaces to the caller is
whichever promise rejected first in time — not necessarily the error the
caller should care about.

Concretely: tryConsume rejects consumed with the sink error and then
rethrows. But a Consumable can also be errored from the other direction —
chunk.error(new Error(...)) is a public method on the class. A sink that
does:

1
2
3
4
5
async write(chunk) {
chunk.error(new Error("consumed error"));
await new Promise((resolve) => setImmediate(resolve));
throw new Error("writer error");
}

rejects consumed with "consumed error" first, and rejects
writer.write with "writer error" a tick later. Under Promise.all, the
caller sees "consumed error" — the earlier rejection — and never learns
that the write itself failed. The write error is swallowed by the
already-settled Promise.all.

That is a real behavioural regression: the error the caller receives no
longer describes the failure that actually stopped the write. The
sequential await writer.write(...) → await consumable.consumed ordering
guarantees the write error wins, because the write error is the one that
causes consumed to reject in the first place.

The author closed #877 at 11:44 UTC with:

Superseded by #878 (which addresses the review comment by attaching a
rejection handler to consumable.consumed while preserving sequential
await writer.write(consumable) and await consumable.consumed).

and opened #878 fifty seconds later.

The fix that survived

PR #878, commit
3e84659c, is the whole of it:

1
2
3
4
5
6
     const consumable = new Consumable(value);
+ // Suppress unhandled-rejection when `writer.write` rejects
+ // before `consumable.consumed` is awaited
+ void consumable.consumed.catch(() => {});
await writer.write(consumable);
await consumable.consumed;

Three lines, and the order of the two awaits is untouched.

The trick is that void consumable.consumed.catch(() => {}) attaches a
rejection handler to consumed immediately, at construction time,
without changing when the function actually awaits it. The .catch() returns
a new promise (which resolves to undefined and is discarded via void);
the original consumed promise is untouched and still rejects as before.
What changes is only that the runtime now considers it handled.

Meanwhile the sequential awaits stay sequential, so:

  • if writer.write rejects → the caller sees the write error, and
    consumed‘s rejection has already been marked handled;
  • if writer.write resolves but consumed rejects → the caller sees the
    consumed error, which is the only error there is.

Both error-precedence rules from the original implementation are intact. The
only thing removed is the orphan.

The regression tests

The 67 added lines in libraries/stream-extra/src/consumable.spec.ts are
worth reading, because they encode the invariants that the Promise.all
version violated. The first test is the direct regression:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
it("WritableStream.write should not emit unhandledRejection when sink write rejects", async () => {
const unhandled: unknown[] = [];
const onUnhandled = (reason: unknown) => {
unhandled.push(reason);
};
process.on("unhandledRejection", onUnhandled);
try {
const stream = new Consumable.WritableStream<Uint8Array>({
async write() {
await Promise.resolve();
throw new Error("sink write failed");
},
});
const writer = stream.getWriter();

await assert.rejects(
Consumable.WritableStream.write(writer, new Uint8Array([1, 2, 3])),
/sink write failed/,
);
await new Promise<void>((resolve) => setImmediate(resolve));
assert.deepStrictEqual(unhandled, []);
} finally {
process.off("unhandledRejection", onUnhandled);
}
});

The await new Promise((resolve) => setImmediate(resolve)) before the final
assertion is the load-bearing part. Node.js emits unhandledRejection on
the next macrotask after a promise is rejected with no handler, not
synchronously. Without the setImmediate turn, the test would pass against
the broken implementation too — the assertion would run before the runtime
had a chance to complain.

The second test is the one that the Promise.all version fails. It pins
error precedence explicitly:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
it("WritableStream.write should wait for writer.write and prefer its rejection over consumed rejection", async () => {
// ...
let writeFinished = false;
const stream = new WritableStream<Consumable<Uint8Array>>({
async write(chunk) {
chunk.error(new Error("consumed error"));
await new Promise<void>((resolve) => setImmediate(resolve));
writeFinished = true;
throw new Error("writer error");
},
});
const writer = stream.getWriter();

await assert.rejects(
Consumable.WritableStream.write(writer, new Uint8Array([1, 2, 3])),
(error: unknown) => {
assert.strictEqual(writeFinished, true);
assert.ok(error instanceof Error);
assert.strictEqual(error.message, "writer error");
return true;
},
);
// ...
});

Two assertions do the work here. error.message === "writer error" checks
that the write error wins over the earlier consumed error. And
writeFinished === true checks the ordering — the helper must not settle
before the underlying write has actually completed, which is what a
concurrent Promise.all would allow. assert.strictEqual(writeFinished, true) inside the rejection predicate is a slightly unusual place for a
state assertion, but it is the natural one: the predicate runs at the moment
the rejection is observed, so it can assert on the world at that instant.

The suite uses node:test and node:assert directly rather than a
framework, and the process.on("unhandledRejection", ...) /
process.off(...) pair is wrapped in try / finally so a failed assertion
does not leak a listener into the next test — which matters, because a
leaked listener on unhandledRejection would make every later test in the
file observe rejections it did not cause.

A note on MaybeConsumable

The same ConsumableWritableStream implementation backs
MaybeConsumable.WritableStream (via
libraries/stream-extra/src/maybe-consumable/writable.ts), so the fix
covers both variants — the CodeRabbit “Linked Issues check” spelled this
out:

This shared ConsumableWritableStream implementation covers the linked
Consumable.WritableStream and MaybeConsumable.WritableStream scope.

MaybeConsumable is the type used by the ADB sync service
(ReadableStream<MaybeConsumable<Uint8Array>>), which is why the fix
matters for file transfer, not just command dispatch.

Where this stands

As of this writing:

  • Issue #876 — open.
  • PR #877 — closed,
    superseded.
  • PR #878 — open, one
    commit, awaiting review from yume-chan.
  • No release. The latest published @yume-chan/stream-extra is still
    3.0.0-beta.4 (published 2026-10-09), and 3.0.0-beta.4 predates this
    fix entirely. npm view @yume-chan/stream-extra dist-tags still reports
    latest: 2.6.1, beta: 3.0.0-beta.4.

The last stream-extra commit on main remains 59e95a0e — “fix(pcm-player):
fix lint error”
, 2026-10-30 — so this change has not landed on main in
any form yet.

A taxonomy of unhandled rejections

This is the fourth unhandled-rejection bug I have tracked in ya-webadb’s
history, and it is worth naming the pattern because they are all the same
shape wearing different clothes:

Issue What leaks Where
#862 AdbServerClient.createTransport unhandled rejection on disconnect adb-server
#859 subprocess wait does not close the process when stdin piping fails adb subprocess
#863 prevent unhandled disconnect rejection adb (fixed)
#876 Consumable.WritableStream.write orphans consumed stream-extra

The common structure: a value is produced by one promise and consumed by
another, and the code that owns both can exit early
. Whenever you have
promiseA and promiseB where failing A implies failing B, attaching
the handler to B after awaiting A is a latent bug — the rejection of
B will outlive the code path that was supposed to observe it.

The void promise.catch(() => {}) idiom is the cheapest fix for that class:
mark it handled eagerly, keep the awaits sequential, and preserve whichever
error-precedence rule you had. #878 is the textbook application.

The other lesson is about the review itself. The first fix was not wrong in
the “it doesn’t compile” sense, or the “it doesn’t fix the bug” sense. It
fixed the reported problem completely and introduced a different one — one
that only shows up when the consumer rejects first and the writer second,
which is a rare interleaving that no ordinary test would produce. It took an
AI reviewer reading the diff specifically for “preserve error precedence” to
find it, and it took a second implementation to get right.

That is a good argument for writing the precedence assertion as an
explicit test rather than trusting the code to look obviously correct. In
the end, #878’s second test does exactly that: it constructs the rare
interleaving on purpose and asserts on which error the caller sees.

What this means for webadb.online

Directly relevant, and the fix is on our critical path.

webadb’s TCP transport in lib/adb-daemon-tcp.ts builds its writable side
from ya-webadb’s AdbPacketSerializeStream, which hands back a
WritableStream<Consumable<AdbPacketInit>> — the exact type whose
Consumable.WritableStream.write helper is being fixed:

1
2
3
4
const serialize = new AdbPacketSerializeStream();
const packetWritable = serialize.writable as unknown as WritableStream<
Consumable<AdbPacketInit>
>;

So when a phone drops off the wireless-debugging socket, our packet writes
go through the buggy path. In the browser the symptom is a console
UnhandledPromiseRejection warning and a rejected promise the UI never
expected — our panels already treat write failures as normal (the device
went away), so the visible effect today is noise in the console rather than a
crash. In Node.js, where the same @yume-chan/stream-extra code runs inside
the ya-webadb CLI tooling, it is fatal.

There is nothing to patch in webadb itself: the fix belongs upstream, in
ConsumableWritableStream.write, and it is one line. What we can do is
track PR #878 until it merges and ships in a stream-extra release, then
bump the dependency — which for us means moving off
@yume-chan/stream-extra@3.0.0-beta.4 to whatever beta lands next.

Until then, the practical mitigation on our side is the one that costs
nothing: our write paths already catch and log socket failures, and adding
a process.on("unhandledRejection") filter in any Node-side tooling we ship
would keep a peer disconnect from taking the process down. In the browser
there is nothing to do — the warning is harmless and the upstream one-line
fix removes it entirely.

One last note on process: the Chromium Direct Sockets check that runs on
Mondays is skipped this week — today is Tuesday, and that source is
weekly by design.

Chrome 158 goes early stable, and the ADB-in-browser feature set finally lands on Android

Chrome 158 started its early-stable rollout on desktop on November 4, and on
November 5 Google shipped Chrome 158 for Android (158.0.8127.22) to “a small
percentage of users” alongside Chrome 157 for Android (157.0.8103.46). That
second release is the one that matters for this blog, because the Android
stable channel is where webadb actually lives — most people running an
ADB-in-the-browser tool are on a phone, and they get Chrome updates on a
completely different cadence than desktop.

Chrome 158’s feature list is the first release where three things that the
ADB-in-browser ecosystem has been waiting on all land in the same build:
Source-Specific Multicast for Direct Sockets, the WebHID API on Android, and
the first real wave of WebTransport ergonomics (reliability attributes,
congestion control, exportKeyingMaterial). None of them are ADB features.
All of them change what a browser can do to a device that webadb wants to
reach.

The other half of the story is quieter: ya-webadb did not merge anything in
the last 24 hours. The upstream repository’s origin/main head is still
0c68ad2f — PR #879, the socket-close refactor — which landed at
2026-11-04T17:25:18Z and which we covered yesterday.
The npm registry confirms it: the last @yume-chan/* publish is
@yume-chan/async 4.2.2 at 2026-11-04T07:35:16Z. So this post is a
Chrome-side post, and it is worth reading as one — the interesting movement
in ADB-in-browser right now is in the browser, not in the library.

Source-Specific Multicast for Direct Sockets, and why the IDL matters

The Direct Sockets entry in Chrome 158’s release notes is
Source Specific Multicast for Direct Sockets API,
tracking bug
#461262401, shipping on
milestone 152 and landing in 158.

We have covered the SSM story twice already — once when the
spec change landed in the WICG repo
in November 2025, and once when the
chromestatus merger entry gave it three LGTMs.
What is new today is not the feature but the shape of the API, which the
finalized spec now pins down. The Direct Sockets specification at
wicg.github.io/direct-sockets
defines two dictionaries:

1
2
3
4
5
6
7
8
dictionary MulticastGroupOptions {
DOMString sourceAddress;
};

dictionary MulticastMembership {
DOMString groupAddress;
DOMString sourceAddress;
};

and the spec text is explicit about the semantics:

The optional IP address of the source for Source-Specific Multicast (SSM).
When present, creates or references a source-specific membership that only
receives multicast packets from this specific source address to the group
address. When absent, creates or references an Any-Source Multicast (ASM)
membership that receives packets from any source. The source address must be
a unicast address and match the IP version of the group address.

So the API surface is a single optional string in a single options dictionary,
and the “IP version must match the group address” rule is a hard constraint —
an IPv6 group address cannot be joined with an IPv4 source and vice versa.
The usage example in the spec is correspondingly small:

1
2
3
// Join SSM group - receive only from 192.0.2.100
await multicastController.joinGroup("232.1.1.1", { sourceAddress: "192.0.2.100" });
console.log('Successfully joined SSM group!');

Two details are worth flagging for anyone planning to use this. First,
MulticastController is [Exposed=(Window, DedicatedWorker), SecureContext, IsolatedContext] — the IsolatedContext requirement means this is not
available to a normal web page, only to an Isolated Web App. That is the
same gating that applies to the whole of Direct Sockets, and it is why
Direct Sockets has never been a viable transport for a plain webadb-hosted
page. Second, the SSM story depends on the permission-policy merger that
shipped back in Chrome 151: direct-sockets-private was replaced with the
granular local-network and loopback-network policies, and the WICG
explainer added a follow-up rule that sending UDP to a multicast address
requires a permission policy
(WICG/direct-sockets#85,
July 2026). SSM without the policy is a no-op.

The practical upshot for webadb: Source-Specific Multicast makes Direct
Sockets useful for the one thing a debugging tool wants and a browser
historically forbade — reaching a device on a LAN without a cloud round-trip
and without accepting packets from every source on the segment.
Today,
adbd over TCP on a LAN is the fallback transport when WebUSB is
unavailable, and it is exposed through a plain fetch to 5555. That works,
but it is one-shot HTTP: no multiplexing, no push channel, and the browser’s
private-network access rules make it increasingly awkward to serve from a
public origin. A raw TCP socket to 192.168.x.x:5555 is a much better fit
for an ADB daemon, and Direct Sockets is the only browser API that can
provide it — but it is gated behind Isolated Web Apps, and SSM’s specific
value (receiving only from the one host you asked for) is a security property
that matters most in exactly the shared-LAN case where you’d use it.

We have been tracking the Direct Sockets chromestatus entries across several
Mondays and the merger entry has been frozen at updated: 2026-06-22 since
April. The feature entry finally moved to updated: 2026-10-27 when the
three LGTMs landed, and now it has a shipping milestone. The merger entry’s
Chrome status still reads "Proposed" with desktop_first: 151 even though
151 shipped months ago — that staleness is a known chromestatus data problem,
not a signal that the policy did not land.

WebHID comes to Android, and it is not about AOA

Chrome 158’s Device section
carries one entry: Support for WebHID,
tracking bug #40628009.

The substance is one sentence:

WebHID shipped on desktop platforms (Windows, macOS, Linux, and ChromeOS) in
Chrome 89. Chrome 158 brings the existing WebHID API to Chrome on Android
(relying on new OS support in Android 17 / API level 37 and later) with no
changes to the web-exposed API surface.

Two things follow. The API surface is unchanged, so nothing in the WebHID
spec changed — this is purely a platform availability change. And it depends
on Android 17 / API level 37, meaning that on Android 16 and below the API
simply will not exist, and on Android 17 it depends on the OS actually
shipping the HID host support the WebHID implementation sits on.

Now, the obvious reaction in an ADB-in-browser context is “does this affect
AOA?” It does not — at least not the way you might hope. ya-webadb’s
aoa
library implements Android Open Accessory protocol by issuing WebUSB
vendor control transfers directly to the phone:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export async function aoaHidRegister(
device: USBDevice,
accessoryId: number,
reportDescriptorSize: number,
) {
await device.controlTransferOut(
{
recipient: "device",
requestType: "vendor",
request: AoaRequestType.RegisterHid,
value: accessoryId,
index: reportDescriptorSize,
},
new ArrayBuffer(0),
);
}

That is navigator.usb, not navigator.hid. AOA’s HID mode is a USB
vendor-specific
protocol that happens to carry HID-shaped reports; it is
not the USB HID class, so the WebHID API has nothing to attach to. The
libraries/aoa/src/hid.ts module talks to the device through
device.controlTransferOut(), never through navigator.hid.requestDevice().

The WebHID-on-Android change matters for a different reason: it means the
browser on Android now exposes a second device-access API alongside
WebUSB, with a device chooser and a permission model that is separate from
the WebUSB one. Two implications for a tool like webadb. First, the
permission surfaces are separate, so a user could in principle grant HID
access while denying USB access — the “your device can’t be reached” error
message needs to be specific about which permission is missing. Second,
WebHID on Android is new enough that the browser-chooser UX is unproven;
the enterprise policy surface listed for the feature
(DefaultWebHidGuardSetting, WebHidAllowAllDevicesForUrls,
WebHidBlockedForUrls, and four others) is where a managed deployment
would lock it down, and on Android WebView is explicitly excluded — “WebView
is not supported, as it does not have a device chooser UI or permissions UX
controls.”

For our purposes the honest summary is: no code change, no new capability
for ADB, but a broader platform story that says Chrome on Android is
investing in hardware access rather than retreating from it. Chrome on
Android shipping WebUSB is what made webadb possible there in the first
place; WebHID landing in the same release suggests the trajectory continues.

The WebTransport wave, and the one thing worth stealing

Chrome 159’s release notes are already filling up with WebTransport work,
and while none of it is in 158 stable, the 158 entries are the leading edge
of a coherent push. In 158:

  • WebTransport reliability attributes
    (#5094058497277952) —
    a WebTransport.reliability instance attribute and a static
    WebTransport.supportsReliableOnly. In Chromium, reliability starts at
    "pending" and flips to "supports-unreliable" once an HTTP/3 session is
    established, because Chromium has no HTTP/2 fallback: every successful
    WebTransport session in Chromium is HTTP/3 with unreliable datagrams
    available.
  • WebTransport draining
    (#6427766428925952) —
    WebTransport.draining is a promise that resolves when the server
    indicates the session will be gracefully retired, so an app can stand up a
    replacement session while the old one is still usable. This is the
    server-initiated-handover primitive that a long-lived device session
    needs.
  • WebTransport anticipated concurrent incoming streams
    (#5089961022980096) —
    constructor hints for initial QUIC stream allowance.
  • WebTransport exportKeyingMaterial
    (#4860330806214656) —
    not 158 but already in the 159 notes, and it is the interesting one: the
    method derives cryptographic keying material bound to an established
    WebTransport session, and for HTTP/3 Chromium includes the WebTransport
    CONNECT stream ID in the TLS exporter context, so two sessions sharing one
    HTTP/3 connection derive different keying material.

That last property is the one worth stealing, and it has a direct analogue
in the ADB world. The ADB daemon protocol has no session identity of its own
beyond the socket’s local/remote id pair, and ya-webadb’s
AdbDaemonSocketController — which yesterday’s post covered in detail
— identifies a logical connection by exactly that pair. A transport-level
per-session secret, derivable by both ends and distinct per session, would
be a materially stronger way to bind a multiplexed ADB connection to the
thing that opened it. Chromium’s exportKeyingMaterial shows the shape of
that primitive exists in a shipping browser API; whether it can be applied
to the ADB protocol is a separate question.

Also worth noting for anyone tracking the WebTransport surface: 159 adds
WebTransport.getStats() (round-trip time, sending rate, expired/lost/dropped
datagram counts, readable after close), a congestionControl constructor
option accepting "default" | "throughput" | "low-latency", the
standardized WebTransportReceiveStream interface with per-stream
bytesReceived vs bytesRead counters, and send groups with sendOrder
prioritization.

What did not happen

Being explicit about the absences, because a daily post that only lists what
shipped reads as marketing.

ya-webadb merged nothing. origin/main is 0c68ad2f, and the commit
window 2026-11-04T01:00:00Z → 2026-11-06T01:00:00Z contains exactly two
commits: ac8447b3 (the Consumable.WritableStream.write unhandled-rejection
fix, PR #878) and 0c68ad2f (PR #879). Both were covered by the Nov 3 and
Nov 5 posts respectively. There are no open PRs newer than #879, no issues
filed since #876, and the npm registry’s most recent @yume-chan/* publish
is @yume-chan/async 4.2.2 from 2026-11-04T07:35:16Z.

The Direct Sockets and WebUSB specs did not move. The WICG
direct-sockets repository’s last commit is a75fe711 from July 10, 2026
(the multicast permission-policy rule). The whatwg/usb repository — which
the WebUSB spec now lives in — last saw a commit on June 5, 2026:
3dcc3c2d, “Restrict control transfers to standard requests and protected
classes”
(whatwg/usb#270), merged by
reillyeon. That change is worth a separate note because it constrains what
controlTransferIn/controlTransferOut can legally do, and the ADB daemon
protocol depends heavily on vendor-specific control transfers — see the
aoaHidRegister snippet above, which is exactly a vendor request type. If
Chrome 158’s control-transfer validation is stricter than what the ADB
daemon protocol needs, that is a breakage for AOA, and it is the kind of
thing worth testing on a real device rather than reasoning about from the
spec.

The WebUSB forget() / close() / disconnect distinction did not
change.
The Nov 4 post covered Chrome 157’s WebUSB disconnect-semantics
change in detail. That analysis still holds; nothing in the last 24 hours
revised it.

No new WebUSB release note or protected-class change. Chrome 158’s
release notes contain no WebUSB entry at all. The API’s only appearance in
158 is by association: WebHID lands on Android alongside it.

What this means for webadb.online

No code changes today, and we are not going to manufacture some. But three
things from this release are worth putting on the record.

First, the Android channel lag is the real story. Chrome 158 has been on
desktop early-stable since November 4 and reaches Android stable today, on a
rollout that is explicitly “a small percentage of users”. The 158 feature set
— SSM, WebHID on Android, the WebTransport reliability work — will be on
Android devices for weeks before it is broadly available. Any conclusion
about Direct Sockets or WebHID on Android drawn from desktop Chrome is
drawing from a build most Android users do not have yet.

Second, Direct Sockets’ value to this ecosystem is now clearer than it has
ever been, and it is still gated behind Isolated Web Apps.
SSM’s promise —
receive only from the specific source you named — is precisely the property
you want when reaching an adbd instance on a shared LAN. But the
IsolatedContext requirement on MulticastController means a plain
webadb-hosted page cannot use it, and the local-network permission policy
from Chrome 151 governs whether an IWA may even try. That is a decision for
the platform, not for us, and the honest position is to keep the current
WebUSB-primary, HTTP-fallback transport matrix while tracking the IWA story.

Third, exportKeyingMaterial is a template. Chromium can now derive
per-session cryptographic material bound to an established session, with
distinct values per logical session even when they share an underlying
connection. The ADB daemon protocol multiplexes several logical connections
over one transport and identifies them by an id pair. Per-session keying
material derived by both ends would be a stronger binding than the id pair
alone. We are not going to propose a protocol change to the ADB daemon from
this blog, but the primitive now exists in a shipping browser API, and it is
worth remembering the next time someone asks why an ADB connection over a
shared transport is trusted at all.

Concretely, the next things we intend to verify on a real device are
whether Chrome 158’s tightened control-transfer validation breaks the
vendor-specific control transfers in the AOA path, and whether the WebUSB
disconnect semantics from Chrome 157 behave identically on the Android
build. Both are device tests, not browser tests, and both are the kind of
question that takes five minutes with a phone plugged in and an hour of
speculation without one.

ya-webadb v3.0.0-beta.5 ships: shared AudioContexts, a socket that closes, and one unhandled rejection less

ya-webadb v3.0.0-beta.5 was tagged at 2026-11-06T02:06:33Z and pushed to npm roughly twenty minutes later. It is the first release in six weeks — beta.4 landed on October 9 — and it packages four commits into a single beta: the Consumable.WritableStream.write unhandled-rejection fix (ac8447b3, PR #878), a large “small improvements” refactor (0c68ad2f, PR #879), the scrcpy inject-key shorthands (3a7d781c), and a PCM player that shares AudioContext instances per sample rate and resumes them automatically (93fce383). If you consume @yume-chan/* on the beta dist-tag, this is a version bump with two breaking API removals in it. If you are on latest (2.6.4 for @yume-chan/adb), nothing changes yet.

The release matters beyond the changelog because beta.5 is the first build where the library’s resource lifecycle got deliberately reworked. Sockets close their ADB-side peer, AudioContexts stop being closed by their owners, and promises that are intentionally not awaited stop being reported as unhandled rejections. Those three things are the same fix applied to three different layers of the same stack, and the fact that they landed together suggests the author was working through a class of “the object outlives its handler” bugs rather than adding features.

The AudioContext sharing change is the most user-visible one

93fce383 rewrites the constructor of PcmPlayer in
libraries/pcm-player/src/index.ts.
Before this commit, every PcmPlayer allocated its own AudioContext:

1
2
3
4
5
6
7
constructor(sampleRate: number, channelCount: number) {
this.#context = new AudioContext({
latencyHint: "interactive",
sampleRate,
});
this.#channelCount = channelCount;
}

Now the constructor takes an optional context, and falls back to a module-level registry keyed by sample rate:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
const SharedContexts = new Map<number, AudioContext>();

function getSharedContext(sampleRate: number) {
if (!SharedContexts.has(sampleRate)) {
SharedContexts.set(
sampleRate,
new AudioContext({
latencyHint: "interactive",
sampleRate,
}),
);
}
return SharedContexts.get(sampleRate)!;
}

The corresponding change in stop() is the interesting half:

1
2
3
4
5
6
7
8
async stop() {
this.#worklet?.disconnect();
this.#worklet = undefined;

this.#buffers.length = 0;

// Do not close the AudioContext as it might be shared.
}

The old code called await this.#context.close(). The new code deliberately does not, because the context may now be owned by someone else. this.#buffers.length = 0 was added in the same place — previously the buffer array was not cleared on stop, so a stopped-then-restarted player would replay every buffered sample through the new worklet node. That is a real bug fix that rode along with the refactor.

The second half of the change is the automatic resume:

1
2
3
4
5
6
7
8
9
10
11
/**
* Starting the AudioContext if it is suspended and the user has interacted with the page.
*/
#tryResuming() {
if (
this.#context.state === "suspended" &&
navigator.userActivation.hasBeenActive
) {
void this.#context.resume().catch(() => {});
}
}

It is called from both feed() and start(). The navigator.userActivation.hasBeenActive guard is the detail worth noting: browsers will not let an AudioContext resume without a user gesture, and attempting it anyway produces a rejected promise that surfaces as an unhandled rejection in the console. By gating on hasBeenActive — which is a sticky flag, not a transient one — the player only attempts the resume when the page has ever been interacted with, and swallows the rejection if the browser still refuses.

The worklet module registration got the same treatment. Because contexts are now shared, audioWorklet.addModule() would be called once per player against the same context, and the second call would fail with InvalidStateError (a module cannot be added twice under the same name):

1
2
3
4
5
6
7
8
9
10
11
12
13
const AddModulePromises = new WeakMap<AudioContext, Promise<void>>();

function addWorkletModule(context: AudioContext) {
if (!AddModulePromises.has(context)) {
AddModulePromises.set(
context,
context.audioWorklet.addModule(
new URL("./worker.js", import.meta.url),
),
);
}
return AddModulePromises.get(context)!;
}

The WeakMap keyed by AudioContext is the correct shape here — it lets a context be garbage collected without the promise map holding it alive.

The practical consequence for anyone building an scrcpy client with audio: you can now start and stop the audio player without tearing down the browser’s audio hardware state. A scrcpy session that stops video but keeps the microphone stream alive, or reconnects to the same device, no longer pays the cost of a fresh AudioContext construction, and no longer silently goes mute because the browser suspended the context when the tab lost focus. The AudioContext construction cost is not trivial — on Chrome it involves a thread handoff to the audio service, and it was the reason many web scrcpy implementations ended up with a permanently-suspended context after the first user gesture was consumed elsewhere on the page.

PR #879 closes the ADB socket properly, and fixes a bug in the process

The bulk of 0c68ad2f is described in the release notes as “small improvements”, which undersells it. The commit touches 50 files across 12 packages and carries the actual socket-lifecycle fix in
libraries/adb/src/daemon/socket.ts.

The change is in AdbDaemonSocketController. Previously the PushReadableStream that carries the socket’s inbound data had no cancellation path, so if a consumer called readable.cancel() — which is what happens when a WebUSB transfer fails mid-stream, or when the application tears down a panel — the ADB daemon was never told. The device kept the socket open, the local socket id stayed allocated, and the daemon-side resource leaked until the whole adbd connection dropped.

The fix wires the stream controller’s abortSignal to the socket’s close():

1
2
3
4
5
6
7
8
9
this.#readable = new PushReadableStream((controller) => {
this.#readableController = controller;

controller.abortSignal.addEventListener(
"abort",
() => void this.close().catch(noop),
{ once: true },
);
});

And enqueue() now short-circuits on a closed socket:

1
2
3
4
5
6
async enqueue(data: Uint8Array) {
if (this.#closed) {
return;
}
await this.#readableController.enqueue(data);
}

That second guard is the one that matters for correctness under race. enqueue() is called from the packet dispatcher when the device sends data; close() is called from the cancellation path. If a packet arrives in the same tick that the consumer cancels the readable, the pre-fix code would call enqueue() on an errored controller — which throws a TypeError from the stream machinery, at a point where the caller’s own error handling was already unwinding. The guard makes the two paths commute.

The close() path also had a latent double-reject bug:

1
2
3
4
5
- this.#availableWriteBytesChanged?.reject(new Error("Socket closed"));
+ if (this.#availableWriteBytesChanged) {
+ this.#availableWriteBytesChanged.reject(new Error("Socket closed"));
+ this.#availableWriteBytesChanged = undefined;
+ }

PromiseResolver#reject on an already-settled resolver is harmless in most implementations but not guaranteed to be, and the new code clears the field so a second close() cannot attempt to reject again.

The PR also introduces a proper type for the dispatcher, AdbDaemonSocketDispatcher, replacing the over-broad AdbPacketDispatcher:

1
2
3
4
5
6
7
8
9
10
11
12
export interface AdbDaemonSocketDispatcher {
options: {
maxPayloadSize: number;
};

sendPacket(
command: AdbCommand,
arg0: number,
arg1: number,
payload: string | Uint8Array,
): Promise<void>;
}

A socket.spec.ts file was added alongside it, and it tests precisely the cancellation behavior:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
it("should close when readable stream cancels", async () => {
const sendPacket = mock.fn<AdbDaemonSocketDispatcher["sendPacket"]>();

const controller = new AdbDaemonSocketController({ /* ... */ });

controller.enqueue(new Uint8Array([1, 2, 3]));

assert.strictEqual(sendPacket.mock.calls.length, 0);

await controller.readable.cancel();

assert.strictEqual(sendPacket.mock.calls.length, 1);
assert.deepStrictEqual(sendPacket.mock.calls[0]?.arguments, [
AdbCommand.Close,
1,
2,
EmptyUint8Array,
]);
});

That assertion — that cancelling the readable side causes exactly one AdbCommand.Close packet to be sent to the peer — is the contract that was previously implicit and untested. Note sendPacket is called with AdbCommand.Close, the local id, the remote id, and an empty payload, which is the ADB daemon’s socket-close wire format.

The unhandled-rejection story, and a new @yume-chan/async API

PR #878 (ac8447b3) is the smallest commit in the release and the one with the clearest rationale. The bug was in
libraries/stream-extra/src/consumable/writable.ts,
in the static write helper:

1
2
3
4
5
6
7
8
export static async write<T>(
writer: WritableStreamDefaultWriter<Consumable<T>>,
value: T,
) {
const consumable = new Consumable(value);
await writer.write(consumable);
await consumable.consumed;
}

writer.write(consumable) can reject — the sink’s write throws, or the stream is already errored — and when it does, the await on the next line never runs, so consumable.consumed is never awaited. Consumable#consumed is a promise that rejects with whatever the sink reported, and nobody attached a handler to it. Node.js and the browser both report that as an unhandled rejection, in a stack frame that has nothing to do with the actual failure.

The fix is two lines:

1
2
3
4
5
6
const consumable = new Consumable(value);
// Suppress unhandled-rejection when `writer.write` rejects
// before `consumable.consumed` is awaited
void consumable.consumed.catch(() => {});
await writer.write(consumable);
await consumable.consumed;

The attached handler is installed before the await, so the rejection is always observed. The await consumable.consumed on the final line still surfaces the real error to the caller — the suppression handler is a no-op sink, not a state change on the promise.

The PR ships two spec files’ worth of regression tests, and the second one is the interesting case. It asserts that writer.write‘s rejection takes priority over the consumed-stream rejection, and that the write is actually complete before the error is raised:

1
2
3
4
5
6
7
8
9
10
11
12
await assert.rejects(
Consumable.WritableStream.write(
writer,
new Uint8Array([1, 2, 3]),
),
(error: unknown) => {
assert.strictEqual(writeFinished, true);
assert.ok(error instanceof Error);
assert.strictEqual(error.message, "writer error");
return true;
},
);

Both tests install a process.on("unhandledRejection", ...) listener and assert that the collected array is empty afterwards — so the tests fail if the fix regresses, not merely if the happy path breaks.

Underneath this sits a broader cleanup. @yume-chan/async was bumped from 4.1.3 to 4.2.2 across every package, and the new version adds two exported functions:

1
2
3
4
5
/**
* Suppress Node.js unhandled rejection warning for a Promise
* @param promise The Promise to suppress unhandled rejection warnings for
*/
export declare function suppressUnhandledRejection(promise: Promise<unknown>): void;
1
export declare function noop(): void;

suppressUnhandledRejection is promise.catch(noop) with a documented intent, and PR #879 replaces every ad-hoc void promise.catch(() => {}) in the codebase with it — in DelayedCloseWritableStream, in TaskQueue, in the ADB sync push request’s SendWritableStream, and in the scrcpy control writer:

1
2
3
4
5
6
7
if (result instanceof Uint8Array) {
await this.write(result);
} else {
suppressUnhandledRejection(result[1]);
await this.write(result[0]);
await result[1];
}

The noop export matters because PR #879 also deleted the local NOOP constant that used to live in libraries/adb/src/utils/no-op.ts and in libraries/stream-extra/src/duplex.ts. In the released beta.5 package, @yume-chan/adb‘s esm/utils/no-op.js now exports a completely different function:

1
2
3
4
export function unreachable(...args) {
// Trigger runtime's unhandled rejection event.
throw new Error("Unreachable. Arguments:\n" + args.join("\n"));
}

That is a breaking change for anyone importing NOOP from @yume-chan/adb. The name changed, the semantics inverted (it now throws instead of doing nothing), and the intent flipped — it exists to make the runtime’s unhandled-rejection machinery fire deliberately, which is the opposite of NOOP‘s old job.

Two API removals that will break a beta.4 consumer

If you are tracking the beta dist-tag, these are the two changes that will fail your build.

ToArrayStream is gone from @yume-chan/adb. It was a public export from
libraries/adb/src/service/subprocess/utils.ts:

1
2
3
4
5
6
7
8
9
10
11
12
export class ToArrayStream<T> extends AccumulateStream<T, T[]> {
constructor() {
super(
[],
(chunk, current) => {
current.push(chunk);
return current;
},
(output) => output,
);
}
}

PR #879 deleted it and replaced every internal use with the new arrayFromAsync helper, added at
libraries/adb/src/utils/array-from-async.ts:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// A simplified version that only works with sync/async iterables that fits our use case.
export async function arrayFromAsyncPolyfill<T>(
items: AsyncIterable<T> | Iterable<MaybePromiseLike<T>>,
) {
const result: T[] = [];
let index = 0;
for await (const item of items) {
Object.defineProperty(result, index, {
value: item,
writable: true,
enumerable: true,
configurable: true,
});
index += 1;
}
result.length = index;
return result;
}

export const arrayFromAsync = Array.fromAsync ?? arrayFromAsyncPolyfill;

The Object.defineProperty + result.length = index dance is deliberate: it makes the array behave like a genuine Array.fromAsync result for a sync iterable whose items are promises, where the element positions are fixed at iteration time but the values settle later. A plain result.push(item) would not produce the same ordering semantics. The native Array.fromAsync is used when the runtime provides it, and the polyfill fills in otherwise — Chrome 121+ ships the native version.

Both the shell-protocol and none-protocol spawners were rewritten to use it:

1
2
3
4
5
6
const [, stdout, stderr, exitCode] = await Promise.all([
options?.stdin?.pipeTo(process.stdin),
arrayFromAsync(process.stdout),
arrayFromAsync(process.stderr),
process.exited,
]);

NOOP is gone — covered above. ToArrayStream was also removed from the side-effect-test toolchain’s export allowlist, which is how the toolchain caught that it was a public API.

The logcat options tightened, and the arguments are now built eagerly

libraries/android-bin/src/logcat.ts got a quieter but user-visible rewrite. The binary() method used to build its argument list lazily inside the WrapReadableStream factory callback; it now builds it eagerly, before the stream is even constructed:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
binary(options?: LogcatOptions): ReadableStream<AndroidLogEntry> {
const args = ["logcat", "-B"];
if (options) {
if (options.dump) {
args.push("-d");
}

if (options.pid !== undefined) {
if (!Number.isSafeInteger(options.pid) || options.pid <= 0) {
throw new Error("PID must be a positive integer");
}
args.push("--pid", options.pid.toString());
}

if (options.ids) {
args.push("-b", Logcat.joinLogId(options.ids));
}

if (typeof options.tail === "number") {
if (!Number.isSafeInteger(options.tail) || options.tail <= 0) {
throw new Error("Tail must be a positive integer");
}
args.push("-t", options.tail.toString());
} else if (options.tail) {
args.push("-t", formatTailTime(options.tail));
}
}

return new WrapReadableStream(async () => {
const process = await this.#adb.subprocess.noneProtocol.spawn(args);
return process.output;
})/* ... */;
}

Three things changed. First, argument validation now happens at call time, not at stream-consumption time — a bad pid throws synchronously out of binary() instead of surfacing later as a spawn failure. Second, pid and numeric tail are validated as positive safe integers; the old code would happily produce --pid 0 or --pid -1, which logcat rejects with a message that does not say which option was wrong. Third, the typeof options.tail === "number" branch was pulled out of the if (options?.tail) truthiness check — the old code treated tail: 0 as absent, which is fine, but it also meant a numeric tail had to pass a truthiness test before its type was checked.

Logcat.logIdToName also stopped silently returning undefined:

1
2
3
4
5
6
7
static logIdToName(id: LogId): string {
const value = LogIdName[id];
if (!value) {
throw new Error(`Unknown LogId: ${id}`);
}
return value;
}

The old return LogIdName[id]! used a non-null assertion on a reverse lookup into a Record<number, string>. The assertion was a lie the type system could not check — the map is indexed by number but LogId is a string enum, so a mismatch between the two would produce undefined at runtime and the ! would silence TypeScript’s complaint about it.

Smaller changes worth naming

The Node TCP connector now uses Readable.toWeb / Writable.toWeb. PR #879 rewrote nodeSocketToConnection in
libraries/adb-server-node-tcp/src/connector.ts,
replacing a hand-rolled PushReadableStream that paused and resumed the socket around every enqueue:

1
2
3
4
5
6
7
8
9
10
return {
readable: Readable.toWeb(socket) as never,
writable: new MaybeConsumable.WrapWritableStream<Uint8Array>(
Writable.toWeb(socket) as never,
),
get closed() {
return closedResolver.promise;
},
/* ... */
};

The old code had a subtle flow-control bug: it called socket.pause(), awaited controller.enqueue(data), then called socket.resume(). If enqueue rejected (because the consumer cancelled), the socket was never resumed and the Node stream stalled. Node’s own toWeb adapters handle backpressure with ReadableStreamDefaultController#desiredSize and resume the socket when the consumer drains.

ReadableStream.from got a real sync-iterable path. In libraries/stream-extra/src/global/streams.ts, the polyfill used to drive both sync and async iterables through an async pull, which meant every chunk of a sync iterable cost a microtask turn and an await. The new version branches:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ReadableStream.from ??= function (iterable) {
if (Symbol.asyncIterator in iterable) {
const iterator = iterable[Symbol.asyncIterator]();
return new ReadableStream({
async pull(controller) { /* ... */ },
async cancel(reason) { /* ... */ },
});
} else {
const iterator = iterable[Symbol.iterator]();
return new ReadableStream({
pull(controller) {
const result = iterator.next();
if (result.done) {
controller.close();
return;
}
controller.enqueue(result.value);
},
cancel(reason) {
iterator.return?.(reason);
},
});
}
};

The sync path’s pull is no longer async and its cancel is no longer async, so a sync iterable drains synchronously as the consumer reads.

adbd subprocess signalling, scrcpy clipboard acks, and Iterator.concat. PR #879 also deleted the bePipedThroughFrom method from WrapWritableStream (it was unused and its promise variable was definitely-assigned only in start(), a latent TDZ hazard), made the scrcpy clipboard ack handler reject with a real message instead of undefined:

1
2
3
4
5
6
7
8
close(): void {
for (const resolver of this.#resolvers.values()) {
resolver.reject(
new Error("Control socket closed before acknowledgment"),
);
}
/* ... */
}

and replaced a hand-written concatStreams helper in adb-scrcpy/src/client.ts with ReadableStream.from(concatIterables(lines, output)), where concatIterables is documented as a polyfill for Iterator.concat().

pnpm-workspace.yaml gained minimumReleaseAgeExclude. The new stanza is:

1
2
minimumReleaseAgeExclude:
- "@yume-chan/async@4.2.2"

pnpm 10.16+ has a minimumReleaseAge setting that refuses to install packages published within the last N minutes, to blunt supply-chain attacks that abuse a fresh publish. Excluding @yume-chan/async@4.2.2 from that gate is what let the workspace resolve a dependency published minutes earlier. The rest of the file was reformatted to four-space indentation.

What did not happen

Chrome moved, but not in a way that affects ADB. Chrome 158 continues its rollout — the early-stable channel since November 4, the Android channel since November 5 — and we covered both in the November 5 and November 6 posts. No new Direct Sockets or WebUSB landing landed in the last 24 hours, and per the weekly cadence this is not a Monday, so the Chrome changelog scan was skipped.

The @yume-chan/async releases are not new today. 4.2.0 published at 2026-11-04T03:15:41Z, 4.2.1 at 07:20:50Z, 4.2.2 at 07:35:16Z. All three are more than 24 hours old. What is new is that beta.5 is the first ya-webadb release to depend on them.

ya-webadb‘s main branch has not moved since the release. origin/main is still d22e9dc3, the release commit itself. The v3.0.0-beta.5 tag points at the same SHA, and the commit is GPG-signed under key A8B69F750B9BCEDD.

What this means for webadb.online

Two of these changes are directly actionable for this project, and one is a heads-up.

The socket-close fix is the one we can verify against our own stack. webadb’s File Manager, App Manager, Logcat, and Screencast panels all hold AdbSocket objects opened over WebUSB, and every one of them has a path where the panel unmounts or the transport errors while a socket is live. Under beta.4, those sockets leaked on the device side. We are going to bump ya-webadb to 3.0.0-beta.5 on a branch, run the existing session-connect and disconnect paths, and check whether the daemon reports a matching socket count before and after a panel teardown. If the count drops, that is a bug fix we have been shipping around for a year.

The AudioContext sharing change is relevant to the Screencast panel’s audio path, which we have not yet wired up but intend to. The relevant constraint for our implementation is that the panel must stop the player without closing the context, and the buffer-clearing fix means a stop/start cycle no longer replays stale audio. We should pass an explicit AudioContext into the player rather than relying on the shared registry, so that a future teardown of the panel can decide what to close.

The ToArrayStream and NOOP removals are a heads-up rather than an action, because webadb does not currently import either. But they are the reason to read the beta release notes before the next dependency bump: NOOP became unreachable, which throws. A project that imports NOOP from @yume-chan/adb and uses it as a .catch() handler would go from “silently ignore” to “throw on every rejection” — the exact opposite of the intent. That is a change worth catching in review rather than in production.

Concretely: the next thing we intend to do is bump the dependency on a branch and verify the socket-close behavior on a real device, since that is the one change in this release with a measurable, observable effect on the device side.

Chrome 159 gives WebTransport datagrams real send priority, and Direct Sockets is still frozen

Chrome 159 is shaping up to be the milestone that completes Chrome’s WebTransport
datagram implementation. Four separate Chrome Platform Status entries are
staged for 159, and two of them were edited yesterday — the
updated timestamps read 2026-11-08T20:24:47Z and
2026-11-08T20:31:02Z. That is the signal worth chasing: Chrome Platform
Status gets edited when a feature’s rollout metadata changes, and a same-day
edit usually means the milestone assignment was just finalized rather than
proposed. The two features are
WebTransport Datagram writable streams and prioritization
and
WebTransport Datagram readable stream type,
and all four 159-staged WebTransport entries share the same
desktop_first=159, android_first=159, webview_first=159 triple.

That is the news. The second half of the story is that Direct Sockets did
not move — and this is a Monday, so we checked it, and it is worth being
precise about why the answer is “still frozen” rather than “no news”.

What Chrome 159 actually adds to the datagram API

The old WebTransport datagram API was famously awkward. Chrome shipped
transport.datagrams.writable and transport.datagrams.readable as
properties, and the only way to send was to grab a writer from a
WritableStream:

1
2
3
const writer = transport.datagrams.writable.getWriter();
await writer.ready;
writer.write(new Uint8Array([65, 66, 67]));

There was no way to express priority. Every datagram queued on the session
went out in whatever order the writer happened to release it, and the
Chrome documentation for the feature had to carry a permanent caveat. MDN
still documents the modern path with a fallback to the deprecated one:

1
2
3
4
const writableStream =
typeof transport.datagrams.createWritable === "function"
? transport.datagrams.createWritable()
: transport.datagrams.writable; // Deprecated and non-standard.

The W3C WebTransport specification (now a Candidate Recommendation Snapshot,
published under the 2025-08-18 W3C Process)
describes the replacement. The datagram send side becomes an interface in
its own right:

1
2
3
4
5
[Exposed=(Window,Worker), SecureContext, Transferable]
interface WebTransportDatagramsWritable : WritableStream {
attribute WebTransportSendGroup? sendGroup;
attribute long long sendOrder;
};

And the duplex stream gains a factory:

1
2
3
4
5
interface WebTransportDatagramDuplexStream {
WebTransportDatagramsWritable createWritable(
optional WebTransportSendOptions options = {});
readonly attribute ReadableStream readable;
};

The sendOrder / sendGroup pair is the interesting part. The spec’s
starvation rule is explicit and unusually strict for a web API:

The send-order rules are that sending in general MAY be interleaved with
sending of previously queued streams and datagrams, as well as streams and
datagrams yet to be queued to be sent over this transport, except that
sending MUST starve until all bytes queued for sending on streams and
datagrams with the same [[SendGroup]] and a higher [[SendOrder]], that
are neither errored nor blocked by flow control, have been sent.

Note the word “MUST starve” — this is not a best-effort hint, it is a
priority inversion guarantee. A low-sendOrder datagram cannot overtake a
higher-sendOrder datagram in the same group. The [[SendGroup]] setter
even throws InvalidStateError if you try to attach a group belonging to a
different transport:

If value is non-null, and value.[[Transport]] is not
[this].[[Transport]], throw an InvalidStateError.

The Chromium implementation, per the release note, “currently applies this
ordering among Datagram writables” — so the priority is scoped within the
datagram channel, not across datagrams and streams. That matches the open
w3c/webtransport#451, where
the working group is still arguing about “relative send priority between
datagrams and streams”. The spec’s own note says the default null send
group is a valid send group, so the grouping mechanism is usable without
ever calling createSendGroup().

On the read side, the new WebTransportOptions.datagramsReadableType
constructor option lets an application ask for a byte stream instead of the
default:

1
2
3
const transport = new WebTransport(url, {
datagramsReadableType: "bytes", // BYOB-capable readable byte stream
});

The default remains a plain ReadableStream; "bytes" opts into BYOB
reading, which matters when you want to read into a caller-owned buffer
rather than letting the stream allocate a fresh Uint8Array per datagram.
This is a small surface area but it is the one that determines whether a
consumer can pool buffers — which is exactly the kind of thing a media
pipeline wants.

The fourth 159 entry, WebTransportError API alignment and serialization,
is cleanup that matters more than it looks. It “adds the standard
(message, options) constructor while preserving the shipped dictionary
constructor for compatibility”, “carries the full unsigned-long stream
error code end to end”, and “makes WebTransportError structured-clonable
while preserving its message, source, and nullable error code”. Serialization
is gated behind a writer-side runtime kill switch, but “decoding remains
permanently enabled for persisted values” — so a WebTransportError can now
survive a postMessage boundary with its numeric code intact. The fifth
entry, WebTransport connection statistics,
ships getStats() exposing round-trip time, an estimated sending rate, and
counts of expired, lost, and dropped datagrams, with “statistics remain
accessible after the connection closes”. That one has been in Chrome since
124 (desktop_first=124, android_first=124) but only reaches Android in
159, which is the part that actually moves for webadb: the Android stable
channel is where the device lives.

The W3C side: the spec caught up three weeks ago

The W3C webtransport repository’s last commit is
91b5a73 (PR #815, “datagram byte cap”), merged 2026-11-04T01:58:41+0100
by jan-ivar. The substantive change underneath it, c8f59da, is titled “Let
UA cap datagram send queue by bytes (fixes #806)”. That closes a real gap:
before this, a producer could queue unbounded datagrams and the user agent
had no sanctioned way to refuse them, so a fast sender on a lossy path could
grow the queue without limit.

The same merge window also brought PR #814 (“categorical stats”), PR #813
(“outgoingmaxage”), PR #812, PR #809 (“pooling-assert”), PR #801
(“error-datagram-writables”), PR #800 (“empty-byob-datagram”), and PR #792
(“exporter-pointers”). Six of those are jan-ivar patches landing inside
roughly ninety minutes, which is the signature of one person doing a
sweep of the implementation-report feedback rather than six independent
design changes.

None of this is in the last 24 hours — the W3C repo’s most recent commit is
five days old. But it explains why Chrome’s 159 wave exists: the spec
gained the byte cap and the error/datagram-writable handling in early
November, and Chromium’s implementation of the same surface was already in
flight. The Chrome Platform Status edits yesterday are the tail end of that
synchronisation.

Direct Sockets: the Monday recheck, and why it is still frozen

It is Monday, which is when this blog does the weekly Direct Sockets
recheck, so here is the state as of 2026-11-09T01:00Z.

The parent feature, Direct Sockets API
(6398297361088512), has updated: 2025-01-14T09:40:14Z by
greengrape@google.com. Its only populated milestone is
desktop_first=131, with android_first and webview_first both empty.
The stage array is otherwise bare: no origin trial ID, no origin trial
documentation URL, no origin trial feedback URL, no rollout platforms, no
rollout_milestone.

The follow-up entry, Direct Sockets API in Shared/Service workers
(5169039028256768), is worse: updated: 2025-01-31T14:48:04Z, and
every milestone field is empty — desktop_first, android_first,
webview_first, rollout_milestone, rollout_platforms, all None. The
summary explains what it was for:

The Direct Sockets API has been launched in Chrome 131 for window &
dedicated worker contexts; this separate entry aims at expanding these to
accommodate shared / service workers to achieve parity with the exposure
of other networking capabilities such as fetch() or WebSockets.

The WICG specification repository is equally quiet. Its last commit is
a75fe71 — “sending udp to multicast address requires permission policy.
(#85)” — dated 2026-07-10T15:58:55+0200. The commit before it,
add094c (PR #84, “Replace ‘direct-sockets-private’ with LNA based
permission policies”), is from 2026-04-24. There have been no commits in
the WICG repo since July, and no commits in the last 24 hours.

And the Chromium source tree itself: a fetch of refs/heads/main covering
2026-11-05T20:56:19Z through 2026-11-08T17:02:57Z — 1,500 commits
covering the last three days — returns zero commits matching Direct Sockets, WebUSB, WebHID, socket (beyond an unrelated Linux
rel-fyi filter cleanup and a WebRTC flake fix), or private-network/PNA.

So the accurate statement is not “no news” but “the Direct Sockets pipeline
is stalled at a specific point”. The spec has been quiet for four months.
The shared/service-worker extension of the API has been on the chromestatus
board since January 2025 with no milestones assigned and no trial registered.
The parent feature has been unchanged since the Chrome 131 launch. The
Chromium tree shows no work in the area.

That combination — a spec that stopped moving in July, a chromestatus
follow-up entry that has never been given a milestone, and a source tree with
no commits in the directory — is the signature of a feature that shipped to
IWA (Isolated Web App) users, generated very little demand, and lost its
chameleon. It is not the signature of a feature that is about to ship.

This is the fourth consecutive Monday where the answer has been “unchanged”,
and the previous three Monday posts traced the same arc: the SSM feature
entry got three LGTMs in late October, and then nothing. The WICG repo’s
last PR is still #85 from July. The merger’s “updated” timestamp has not
moved in twenty-two months.

One more thing worth recording: the Chromium tree is genuinely quiet

A detail that is easy to miss and worth stating explicitly, because “no
commits” is usually a signal that you searched the wrong thing. In the
1,500-commit window covering November 5 through November 8, there are no
commits matching WebTransport either. The Chrome 159 WebTransport wave did
not land in that window — it landed earlier, and what happened yesterday was
the rollout metadata on chromestatus being finalized.

That is a distinction worth keeping straight, because a blog post that says
“Chrome 159 added X on November 8” would be wrong. The implementation
shipped in the preceding weeks; what we can date precisely is the chromestatus
edit. 5183354944225280 and 5148774971342848 were both written on
November 8, 2026, by monicach@microsoft.com — who has been driving the
Chrome WebTransport datagram implementation for the entire feature set, going
back to the WebTransportError alignment entry on 2026-11-04T16:31:42Z and
the connection-statistics entry on 2026-11-05T19:50:25Z. Four of the four
159-staged entries have been touched by the same engineer in the last five
days.

What this means for webadb.online

No code changed in webadb this week, and no ya-webadb release either — the
upstream origin/main head is still d22e9dc (“chore: release
v3.0.0-beta.5”), the npm dist-tags are still latest: 2.6.4 /
beta: 3.0.0-beta.5, and the most recently updated pull request is still
#879, closed on
2026-11-04T17:25:21Z. Nothing to report on that side.

The WebTransport work is not immediately actionable for us either, and it is
worth being precise about why rather than hand-waving. webadb has no
WebTransport transport today: grep -rn "WebTransport" --include=*.ts --include=*.tsx over the repository returns nothing, and the @yume-chan/*
package list contains adb-daemon-webusb, adb-server-node-tcp, and
aoa — but no WebTransport implementation. The ADB protocol over WebTransport
would require an HTTP/3-capable ADB server endpoint that speaks the ADB
protocol over a QUIC connection, which is not something a browser can reach
a phone with today.

What Chrome 159 does buy us is the primitive. Once WebTransportDatagramsWritable
with sendGroup / sendOrder is available on Android — and android_first=159
says it will be — a future WebTransport-based ADB transport would have a
priority-aware datagram channel, a BYOB-capable readable byte stream, and
surviving error codes. Those three together are exactly the set of things
that make a datagram channel usable for something like scrcpy’s control
channel, where video frames must not be starved by log traffic.

So: no impact on webadb this week, because we have no WebTransport transport
to upgrade — but this is the first Chrome release in a while that closes the
gap between “WebTransport datagrams exist” and “WebTransport datagrams are
usable as a prioritized, bidirectional, byte-streamed channel”, which is the
prerequisite for anything other than WebUSB in the browser-ADB transport
story. Direct Sockets, for the fourth Monday running, remains frozen at
Chrome 131 with no trial and no milestones, and we are no longer expecting
it to move.

Chrome 159 ships WebTransport getStats() on Android — and Chromium implements 5 of the spec's 13 fields

Chrome’s WebTransport connection-statistics entry was rewritten yesterday — updated: 2026-11-09T19:33:48Z by vbryhider@microsoft.com — and what it now says is that WebTransport.getStats() ships in Chrome 159 on desktop, Android, and WebView alike. What makes this interesting is not the milestone assignment; it is the gap between the spec’s thirteen dictionary members and the five that Chromium actually implements, and the fact that Chromium’s own runtime flag for the whole feature is still experimental while every one of its sibling WebTransport flags flipped to stable in the preceding three days.

The second story is quieter but closer to home. Chrome Platform Status’s Permissions-Policy-for-workers entry was also touched yesterday, updated: 2026-11-09T14:35:29Z by antoniosartori@chromium.org, and the explainer behind it names WebUSB and WebHID — by URL — as the use cases it is designed to unblock.

The milestone: stage 260, all three platforms, 159

The WebTransport connection statistics
entry (5120203192139776) carries four stages. Stage 220 is the intent-to-ship
placeholder; stage 230 carries the historical desktop_first=124, android_first=124 — the release where getStats() first appeared; stage 250
is the origin-trial slot, and it is empty (ot_action_requested: false,
origin_trial_id: null, no trial feedback URL). Stage 260 is the one that
matters:

1
2
3
4
5
stage_type: 260
desktop_first: 159
android_first: 159
webview_first: 159
intent_thread_url: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6aecbed8.dafb4d6f.4865.0071.GAE%40google.com

159 is the milestone this blog has been tracking since the Chrome 158
cycle — the same number that carried
WebTransport Datagram writable streams and prioritization
and WebTransport Datagram readable stream type
yesterday. But those two were about sending datagrams. This one is about
observing the connection, and the distinction matters for a completely
practical reason: getStats() is the API you call when you want to know
why your datagrams are not arriving.

The feature is classified feature_type: "Chromium catches up", which is
the chromestatus taxonomy for “the spec has this, Firefox and Safari have
this, Chromium does not”. The entry’s own interoperability note is
unusually candid about the state of the art:

Firefox and Safari expose getStats(), but implementation maturity and
returned fields vary between all browsers.

The WebTransport specification currently defines connection byte/packet
counters (bytesSent, bytesSentOverhead, bytesAcknowledged, packetsSent,
bytesLost, packetsLost, bytesReceived, packetsReceived) and
atSendCapacity; Chromium does not expose these members. Applications
should check for optional members rather than assume that every browser
returns the same subset.

That last sentence is the one to internalise. getStats() is a
feature-detect-and-branch API, not a uniform one.

The spec defines thirteen fields; Chromium implements five

The W3C WebTransport Editor’s Draft, §6.13, defines the connection-stats
dictionary in full:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dictionary WebTransportConnectionStats {
unsigned long long bytesSent;
unsigned long long bytesSentOverhead;
unsigned long long bytesAcknowledged;
unsigned long long packetsSent;
unsigned long long bytesLost;
unsigned long long packetsLost;
unsigned long long bytesReceived;
unsigned long long packetsReceived;
DOMHighResTimeStamp smoothedRtt;
DOMHighResTimeStamp rttVariation;
DOMHighResTimeStamp minRtt;
required WebTransportDatagramStats datagrams;
unsigned long long? estimatedSendRate = null;
boolean atSendCapacity = false;
};

Chromium’s own IDL,
third_party/blink/renderer/modules/webtransport/web_transport_connection_stats.idl,
is a strict subset:

1
2
3
4
5
6
7
dictionary WebTransportConnectionStats {
DOMHighResTimeStamp smoothedRtt;
DOMHighResTimeStamp rttVariation;
DOMHighResTimeStamp minRtt;
required WebTransportDatagramStats datagrams;
unsigned long long? estimatedSendRate = null;
};

Five members against the spec’s thirteen. Every byte and packet counter is
absent, and so is atSendCapacity. What survives is the latency trio, the
nested datagram stats, and the send-rate estimate. The datagram dictionary
itself is implemented completely —
web_transport_datagram_stats.idl has all four members
(expiredOutgoing, droppedIncoming, expiredIncoming, lostOutgoing) —
which lines up with the chromestatus summary’s promise of “counts of
expired, lost, and dropped datagrams”.

The omission is deliberate, not an oversight, and the reason is visible in
the renderer source. WebTransport::ConvertStatsFromMojom() in
web_transport.cc copies the network-service mojom struct field by field:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
WebTransportConnectionStats* WebTransport::ConvertStatsFromMojom(
network::mojom::blink::WebTransportStatsPtr in) {
auto* out = MakeGarbageCollected<WebTransportConnectionStats>();
// QUIC initializes min_rtt to zero until it has a valid RTT sample.
if (in->min_rtt.is_positive()) {
out->setMinRtt(in->min_rtt.InMillisecondsF());
out->setSmoothedRtt(in->smoothed_rtt.InMillisecondsF());
out->setRttVariation(in->rtt_variation.InMillisecondsF());
}
if (in->estimated_send_rate_bps > 0) {
out->setEstimatedSendRate(in->estimated_send_rate_bps);
} else {
out->setEstimatedSendRate(std::nullopt);
}
auto* datagram_stats = MakeGarbageCollected<WebTransportDatagramStats>();
datagram_stats->setExpiredOutgoing(in->datagrams_expired_outgoing);
datagram_stats->setLostOutgoing(in->datagrams_lost_outgoing);
UpdateIncomingDatagramStats(datagram_stats);
out->setDatagrams(datagram_stats);
return out;
}

There is no branch for bytes_sent, no branch for packets_lost, no branch
for at_send_capacity. The mojom struct simply does not carry them.
Chromium’s network service exposes a QUIC-level stats subset and Blink maps
it one-to-one.

Two details in that function are worth pausing on, because both are places
where the observable behaviour differs from the naive reading of the spec.

The RTT triple is all-or-nothing. The if (in->min_rtt.is_positive())
guard means that if QUIC has not yet collected a valid RTT sample, all
three
RTT members stay absent — smoothedRtt, rttVariation and minRtt
are missing together, even though smoothedRtt and rttVariation might
have had values. The spec’s note on the dictionary says only “Any
unavailable stats will be absent from the WebTransportConnectionStats
dictionary”, which does not warn you that they arrive as a correlated
group. Code that does stats.smoothedRtt ?? 0 will silently report a
zero RTT for a freshly-opened connection rather than an absence.

estimatedSendRate is a nullable that can go backwards. The spec is
explicit: “If the user agent does not currently have an estimate, the member
MUST be the null value. The member can be null even if it was not null in
previous results.” Chromium’s mapping honours this — `estimated_send_rate_bps

0produces a number, anything else producesstd::nullopt. But note the unit: the mojom field is named _bpsand the spec's field isunsigned long long?, described as "the estimated rate at which queued data will be sent by the user agent, in bits per second". The spec dictionary's declared type (unsigned long long`) does not match its own
prose unit (bits per second), which is a spec wart worth noting if you
ever try to compare the value against a byte counter.

atSendCapacity is the field everyone will want, and it is the one Chromium does not have

atSendCapacity is the boolean that tells you whether the send-rate
estimate is meaningful. From the spec:

A value of false indicates the estimatedSendRate might be application
limited, meaning the application is sending significantly less data than
the congestion controller allows. A congestion controller might produce a
poor estimate of the available network capacity while it is application
limited.

A value of true indicates the application is sending data at network
capacity, and the estimatedSendRate reflects the network capacity
available to the application.

When atSendCapacity is true, the estimatedSendRate reflects a ceiling.

This is the difference between “the network is slow” and “you are not
sending enough to saturate it” — the single most common misdiagnosis in
any adaptive-rate video or audio pipeline. Chromium does not expose it.
The renderer never sets it, and the IDL does not declare it, so
stats.atSendCapacity is undefined in Chrome 159 no matter what the
network is doing.

The chromium-status entry’s interop_compat_risks field names this
exactly, listing atSendCapacity alongside the eight byte and packet
counters as members Chromium does not expose. The spec’s own text explains
why it might be hard to implement: the estimate has to distinguish an
application-limited sender from a network-limited one, and the spec
acknowledges the “pooled connection” complication — when a session rides an
existing connection, only members marked as pooled connection stats are
revealed, and atSendCapacity, smoothedRtt, rttVariation, minRtt
and estimatedSendRate are the five that carry that marker.

The flag that is still experimental

Here is the detail that makes this more than a routine milestone story.
getStats() is not a plain method in Chromium — it is gated:

1
2
[CallWith=ScriptState, RuntimeEnabled=WebTransportStats]
Promise<WebTransportConnectionStats> getStats();

And in
third_party/blink/renderer/platform/runtime_enabled_features.json5,
the flag’s entry is not stable. It is the only one in the whole WebTransport
block that is not:

1
2
3
4
5
6
7
{
// Note: enabling this without setting WebTransportCongestionControl to
// either BBRv1 or BBRv2 will produce poor bandwidth estimates.
name: "WebTransportStats",
status: "experimental",
base_feature: "none",
},

Compare that to its immediate neighbours in the same file as of the
current refs/heads/main:

Flag Status Flip commit Date
WebTransportReceiveStream stable 74ac1565e4e4 2026-11-04
WebTransportSendGroup stable e74069210529 2026-11-04
WebTransportCongestionControl stable 665a26498b6a 2026-11-02
WebTransportExportKeyingMaterial stable c8d2a52b660d 2026-10-29
WebTransportDatagramsWritable stable c389dc69815b 2026-11-05
WebTransportDatagramsReadableType stable 2f09e1584e25 2026-11-06
WebTransportStats experimental — —

Six WebTransport flags flipped experimental → stable in the eight days
between October 29 and November 6. WebTransportStats did not go with them,
and the comment in the file explains the dependency: the send-rate estimate
comes from the congestion controller, so the flag’s usefulness is
conditional on WebTransportCongestionControl being set to BBRv1 or BBRv2
rather than left at the default.

That is a coherent engineering decision — shipping a bandwidth estimate
derived from a cubic congestion controller is how you get a number that
looks authoritative and is wrong. But it does mean that “Chrome 159 ships
getStats()“ and “getStats() is available to you in Chrome 159” are
different claims. The first is what chromestatus now says; the second
depends on a runtime flag that is off by default and has no base_feature
to enable it through a command-line switch on stable builds. On stable
Chrome, transport.getStats may well be undefined. On Chrome for Testing
or a --enable-features=WebTransportStats build, it is there, and the
estimatedSendRate it returns is the BBR-derived number the flag comment
warns about.

The send-group statistics that arrived in October

There is a second, older piece of this surface that landed before the
milestone announcement: send-stream and send-group statistics.
Chromium commit 4cc5073b6b2a — “WebTransport: implement GetStats for
SendGroup” — landed on 2026-10-23T00:21:34Z, reviewed by Nidhi Jaju and
Matthew Denton, and commit-queued by Viktoriya Bryhider (the same
vbryhider@microsoft.com who owns the chromestatus entry). It is a large
change: fifteen files, +665/−138, with web_transport_send_group.cc alone
gaining 129 lines and web_transport_test.cc gaining 344.

The commit message describes the mechanics:

Replace zeroed send group statistics with aggregated bytes written, sent,
and acknowledged for the group’s members. Snapshot membership when
getStats() is called so later reassignment does not change which streams
contribute to the pending result.

Track membership changes and fold finalized stream counters into group
totals, preserving statistics without retaining completed streams.

Request statistics for all active members in a single network-service
IPC. Share pending requests between stream and group queries, and keep
requests pending when statistics are temporarily unavailable until a
terminal notification or connection cleanup completes them.

That last clause is the interesting one — it is a pending-request state
machine shared between stream-level and group-level queries, and it has to
survive a member disappearing mid-flight. The “snapshot membership when
getStats() is called” rule is the spec-consistent behaviour: the answer
reflects the group as it was when you asked.

The spec’s per-stream dictionaries are correspondingly small:

1
2
3
4
5
6
7
8
9
10
dictionary WebTransportSendStreamStats {
unsigned long long bytesWritten;
unsigned long long bytesSent;
unsigned long long bytesAcknowledged;
};

dictionary WebTransportReceiveStreamStats {
unsigned long long bytesReceived;
unsigned long long bytesRead;
};

bytesWritten versus bytesSent versus bytesAcknowledged is the trio
that matters most for a sender: bytes written is what the application
handed to the stream, bytes sent is what left the machine, bytes
acknowledged is what the peer confirmed. The gap between written and
acknowledged is your in-flight-and-lost window. Chromium does not expose
the same trio at the connection level — it is available only per stream
and per send group.

Permissions Policy for workers: the WebUSB angle

The second entry touched yesterday is
Permissions Policy for workers
(5073502741856256), updated 2026-11-09T14:35:29Z by
antoniosartori@chromium.org. Unlike the WebTransport entry, this one is
not close to shipping: its stages run 110 through 160 (intent to prototype
through intent to ship) and all six are bare — no milestones, no origin
trial, no rollout platform. The chromestatus chrome.status field reads
Proposed.

What is notable is the explainer. The
workers-permissions-policy
README lists its example use cases, and the first one is “Connected devices
APIs” — with a list of APIs that are “normally only exposed to documents”:

As those APIs are normally gated behind Permissions Policy, extending
Permissions Policy to workers seems a prerequisite for shipping those APIs
to workers in a consistent way.

WebUSB is second on that list. That is not a coincidence for this project,
and it explains why the Chromestatus entry is worth watching even at the
“Proposed” stage: WebUSB is currently a document-context-only API, and
navigator.usb.requestDevice() cannot be called from a worker. A worker
cannot open a USB device, which means an ADB client implemented on top of
WebUSB cannot currently be moved off the main thread — the WebUSB session
handling, the ADB daemon WebUSB transport, and the sync protocol all have to
run where navigator.usb exists.

This is the continuation of a thread this blog started on November 2, when
Chromium’s PermissionsPolicyForSharedWorkers landed across six CLs. The
flag’s current state in
runtime_enabled_features.json5 is unchanged since then:

1
2
3
4
5
{
name: "PermissionsPolicyForSharedWorkers",
status: "experimental",
public: true,
},

The October work is still visible in the tree. Two commits from
2026-10-20T15:42:05Z and 2026-10-20T15:42:21Z — c40fd2ef2dec and
3aa2f4ff7f9e, both queued by Antonio Sartori — implement the shared-worker
half of the model:

1
2
3
4
5
6
7
8
9
10
c40fd2ef2dec  [PermissionsPolicyForWorkers] Parse SharedWorkerOptions.allow
Parse the allow attribute on SharedWorkerOptions using
PermissionsPolicyParser::ParseAttribute() in SharedWorker::CreateImpl()
when PermissionsPolicyForSharedWorkers is enabled, and log any parser
messages to the execution context console.

3aa2f4ff7f9e [PermissionsPolicyForWorkers] Check 'allow' against creator
Verify in SharedWorker::CreateImpl() that the creator ExecutionContext
can delegate to the worker origin every feature parsed from
SharedWorkerOptions.allow, and trigger Sharedworker.onerror otherwise.

Both are part of tracking bug 562705553. The shared-worker model the
explainer proposes is the strict one: capabilities are delegated at
creation
via an allow option, and a subsequent context connecting to the
same shared worker must pass a compatible allow or the connection fails —
the same shape as cross-origin iframes, and deliberately not the same
shape as dedicated workers, which inherit their creator’s policy wholesale.

For webadb, the dedicated-worker case is the interesting one, and it is
already effectively working: “for same-origin workers this would currently
basically result in inheriting the parent’s Permissions Policy, a behavior
which is already implemented by some vendors and is also covered by WPTs”.
The explainer notes the HTML standard “manually checks the creator’s
Permissions Policy for dedicated workers, but not for shared workers,
because of the multiple inheritance issue that this proposal aims to solve”.

The other two use cases are less speculative. SharedArrayBuffer and
cross-origin isolation are already the foundation of webadb’s deployment —
public/_headers sets COOP/COEP/CORP so ya-webadb can use
SharedArrayBuffer — and the explainer’s point is that the
cross-origin-isolated policy-controlled feature is currently checked by
hand in the HTML standard for dedicated workers but not for shared workers.
And Local Network Access, which gates local network requests behind
Permissions Policy, “currently forbids local network access from workers”
for exactly the same reason.

What shipped in webadb itself

One code change landed in this repository in the last 24 hours, and it is
about the flakiest part of the ADB-in-browser story: installing an APK.
Commit f0720bf — “fix(apk): add -d -g –user 0 to pm install, retry
minimally, verbose diagnostics” — changed
components/ApkInstallPanel.tsx.

The installer previously ran pm install -r -t <path> and, on failure,
reported “pm install returned exit 1” plus whatever was on stdout. The new
flag set is:

1
pm install -r -t -d -g --user 0 /data/local/tmp/<name>.apk

with -d allowing a version downgrade, -g granting runtime permissions
at install time so the app is not dead-on-arrival with an empty permission
set, and --user 0 targeting the primary user explicitly. Notably absent
is -s: that flag means “install on shared storage”, which Android 11+
rejects for third-party APKs with
INSTALL_FAILED_INVALID_INSTALL_LOCATION, and which places the app
somewhere the launcher does not index.

The more interesting part is the retry. If the extended flag set fails, the
installer automatically retries with a bare pm install -r <path> — the
exact command that works from a terminal. The reasoning is that some OEM
skins (HyperOS in particular) reject combinations of individually-valid
flags, which means no amount of flag-reading on the host side will save
you; you have to try the minimal form.

And when both fail, the panel now attaches real diagnostics: the full
command line that ran, the combined stdout and stderr (pm install reports
failures on stdout, not stderr, which is why the original message was so
empty), an ls -lZ of the staged file so a truncated or permission-broken
upload is distinguishable from a bad APK, and the device’s own
pm install --help output so the user can see exactly which flags their
Android build accepts. Two specific tokens get a plain-English hint:
INSTALL_PARSE_FAILED_NO_COLLECTED_CERTIFICATES (the staged file may be
truncated or unreadable) and INSTALL_FAILED_UPDATE_INCOMPATIBLE (the
signing key differs from the installed app — uninstall it first).

There is one more small change worth naming: the staged filename is forced
to end in .apk. Files named without the extension are rejected outright
by some devices, and a browser file picker makes it easy to pick up a file
called app-release-final that is actually an APK.

What this means for webadb.online

Two of these three stories are upstream primitives, and neither is
actionable this week — but one of them changes what we can plan for.

WebTransport.getStats() gives us a way to tell “the network is slow”
apart from “the application is not sending enough”, and it gives us
per-datagram expired/lost/dropped counters that a QUIC-based ADB transport
could surface as a connection-quality readout. The caveat is precise:
Chromium exposes five of the spec’s thirteen members and, more
importantly, the whole method sits behind a runtime flag that is still
experimental — so on stable Chrome 159 you should feature-detect
typeof transport.getStats === "function" and expect
stats.atSendCapacity to be undefined even when the call succeeds.

The Permissions Policy for workers story is the closer one, because its
first listed use case is WebUSB. The day Permissions Policy works in
workers, navigator.usb can be exposed to a dedicated worker, and the
WebUSB session handling in ya-webadb — which today has to run on the
main thread because that is the only place navigator.usb exists — could
move off it. That is not a small refactor for us, but it is the kind of
constraint removal that is worth noticing six months before it lands.

No impact on webadb’s runtime behaviour this week, beyond the APK
installer fix: ya-webadb’s origin/main head is still d22e9dc (“chore:
release v3.0.0-beta.5”), there are no new commits, no new pull requests,
and no new releases since the beta.5 announcement this blog covered on
November 7. The last activity in the upstream repository remains
PR #879, closed on
2026-11-04T17:25:21Z. Direct Sockets was not re-checked — that is a
Monday ritual, and it will be due tomorrow.

ya-webadb learns to close its sockets properly, and adopts Array.fromAsync

ya-webadb merged a 585-line refactor yesterday that does something it should
have done a long time ago: when you cancel the readable side of an ADB daemon
socket, it now actually tells adbd to close the connection, by sending an
explicit CLOSE packet. The commit is 0c68ad2f, PR
#879, merged at
2026-11-04T17:25:18Z. In the same PR the library picks up
Array.fromAsync (with a hand-written fallback for engines that lack it),
rewrites the Node.js TCP transport to use node:stream‘s own web-stream
adapters instead of hand-rolling them, and starts validating its logcat
arguments instead of silently passing garbage to the device.

Three separate npm packages moved on the same day. @yume-chan/async went
4.1.3 → 4.2.0 → 4.2.1 → 4.2.2, the last three published inside four
hours of each other on November 4, and the final one is the version that
introduces noop and suppressUnhandledRejection — the two helpers the
refactor leans on most.

The socket close bug: cancelling a stream now closes the ADB connection

This is the substantive change, and it is in
libraries/adb/src/daemon/socket.ts.

The ADB daemon protocol multiplexes several logical connections (“sockets”
in adb’s vocabulary — shell:, sync:, tcp:, and friends) over one USB
or TCP transport. Each one is a separate stream pair with its own local and
remote id. The wire protocol has a CLOSE command, and it has to be sent
explicitly; the remote side is not going to infer the close from the USB
transport dropping.

The old AdbDaemonSocketController had no mechanism for this. If a consumer
called readable.cancel() — which is exactly what happens when a shell
session’s PTY is torn down, or a sync: pull is abandoned mid-file — the
library simply stopped enqueuing data. The CLOSE packet was never sent.
adbd on the device kept the socket open, waiting for more data on a
connection nobody would ever read from.

The fix hooks into the abort signal that PushReadableStream already
exposes:

1
2
3
4
5
6
7
8
9
this.#readable = new PushReadableStream((controller) => {
this.#readableController = controller;

controller.abortSignal.addEventListener(
"abort",
() => void this.close().catch(noop),
{ once: true },
);
});

PushReadableStreamController.abortSignal is now documented in the
stream-extra type declarations as “an AbortSignal that aborts when the
stream is cancelled by the consumer”
— before this PR it existed but was
undocumented, and almost nobody knew it was the hook you were supposed to
use.

The PR adds a regression test that pins the behaviour precisely
(libraries/adb/src/daemon/socket.spec.ts):

1
2
3
4
5
6
7
8
9
10
11
12
controller.enqueue(new Uint8Array([1, 2, 3]));

assert.strictEqual(sendPacket.mock.calls.length, 0);

await controller.readable.cancel();

assert.strictEqual(sendPacket.mock.calls.length, 1);
assert.deepStrictEqual(sendPacket.mock.calls[0]?.arguments, [
AdbCommand.Close,
1, 2,
EmptyUint8Array,
]);

Read that carefully: the close packet carries the local and remote ids and
an empty payload, and it is sent exactly once. close() opens with an
if (this.#closed) return; guard, so a socket closed twice sends one
CLOSE packet, not two — a protocol violation the ADB daemon would
interpret as a mismatched close.

Two smaller fixes in the same file matter for the same reason. enqueue()
now early-returns if the socket is already closed, so a late-arriving chunk
cannot be pushed into a stream that has already errored:

1
2
3
4
5
6
async enqueue(data: Uint8Array) {
if (this.#closed) {
return;
}
await this.#readableController.enqueue(data);
}

And the write-back-pressure promise is now nulled out when it is rejected,
rather than being rejected-and-retained. Previously the rejected promise
stayed reachable on the instance, which meant a second close() would try
to reject it again — a no-op at best, and a double-settle hazard at worst:

1
2
3
4
if (this.#availableWriteBytesChanged) {
this.#availableWriteBytesChanged.reject(new Error("Socket closed"));
this.#availableWriteBytesChanged = undefined;
}

The dispatcher dependency was also narrowed. AdbDaemonSocketInit used to
take a full AdbPacketDispatcher; it now takes an
AdbDaemonSocketDispatcher, a three-member interface
(options.maxPayloadSize, sendPacket). That is a genuine API change for
anyone constructing a socket directly, but it makes the socket’s actual
dependencies visible in the type instead of hiding them behind the full
dispatcher surface.

Array.fromAsync, and a polyfill that does something slightly clever

The PR deletes ToArrayStream — an AccumulateStream subclass that
collected a stream into an array — and replaces every call site with
Array.fromAsync. Service.readdir() in
libraries/adb/src/service/sync/service.ts
loses its explicit TODO: Convert to Array.fromAsync comment along with
six lines of code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// before
async readdir(path: string) {
// TODO: Convert to `Array.fromAsync`
const results: OpenDir.Entry[] = [];
for await (const entry of this.opendir(path)) {
results.push(entry);
}
return results;
}

// after
readdir(path: string) {
return arrayFromAsync(this.opendir(path));
}

The same substitution happens in the two subprocess spawners, where
process.stdout.pipeThrough(new ToArrayStream()) becomes
arrayFromAsync(process.stdout). This is the path that every adb shell
command in webadb goes through, so it is worth noting what changed
structurally: the old code pushed chunks into a preallocated array through a
TransformStream; the new code drains the async iterable directly. One
fewer stream in the chain.

Because Array.fromAsync is not available everywhere, the library ships a
fallback in a new file,
libraries/adb/src/utils/array-from-async.ts:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export async function arrayFromAsyncPolyfill<T>(
items: AsyncIterable<T> | Iterable<MaybePromiseLike<T>>,
) {
const result: T[] = [];
let index = 0;
for await (const item of items) {
Object.defineProperty(result, index, {
value: item,
writable: true,
enumerable: true,
configurable: true,
});
index += 1;
}
result.length = index;
return result;
}

export const arrayFromAsync = Array.fromAsync ?? arrayFromAsyncPolyfill;

The Object.defineProperty dance is worth pausing on. A plain
result[index] = item would work identically here, because for await
already unwraps promises. The defineProperty form is there so that the
property is explicitly marked enumerable: true — which is the default for
array index properties anyway — but also writable and configurable, which
matches array index semantics exactly. The author calls it “a simplified
version that only works with sync/async iterables that fits our use case”
,
and the type signature reflects the narrowing: no array-like objects, no
mapFn, no thisArg.

I extracted the implementation and ran it against the three fixtures from the
PR’s own spec file:

1
2
3
4
async iterable: [ 1, 2, 3 ] isArray: true len: 3
sync iterable: [ 4, 5, 6 ] isArray: true
sync iterable w/ promises: [ 7, 8, 9 ]
native Array.fromAsync: function

The third case is the one the type signature is really about: a synchronous
iterable that yields promises. for await unwraps each one, so the resulting
array holds resolved values, and the polyfill’s return type
Iterable<MaybePromiseLike<T>> matches that behaviour.

Array.fromAsync has been Baseline widely available since January 2024,
so the polyfill is belt-and-braces in any browser we care about. But
ya-webadb ships to Node.js, Deno, Bun, and workers too, and the
?? arrayFromAsyncPolyfill fallback costs nothing at runtime.

What is more interesting is what the polyfill’s existence signals: the
stream-extra library has been maintaining its own ReadableStream.from
shim for a while, and this PR changes its behaviour.

ReadableStream.from now has a genuinely separate sync path

In
libraries/stream-extra/src/global/streams.ts,
the polyfill for the (now standard) ReadableStream.from() static method
used to handle sync and async iterables with one code path — it checked
Symbol.asyncIterator in iterable, picked an iterator, and then used an
async pull() regardless.

The new version splits them:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if (Symbol.asyncIterator in iterable) {
const iterator = iterable[Symbol.asyncIterator]();
return new ReadableStream({
async pull(controller) {
const result = await iterator.next();
if (result.done) {
controller.close();
return;
}
controller.enqueue(result.value);
},
async cancel(reason) {
await iterator.return?.(reason);
},
});
} else {
const iterator = iterable[Symbol.iterator]();
return new ReadableStream({
pull(controller) { // ← no longer async
const result = iterator.next();
if (result.done) {
controller.close();
return;
}
controller.enqueue(result.value);
},
cancel(reason) {
iterator.return?.(reason);
},
});
}

The sync branch’s pull is now a plain synchronous function, and its
cancel is synchronous too. That is not cosmetic: a synchronous pull
means the stream can produce its first chunk without ever yielding to the
microtask queue, which removes a tick of latency from the start of every
sync-iterable-backed stream.

ReadableStream.from is used in exactly the place you would expect from
the scrcpy client, in
libraries/adb-scrcpy/src/client.ts,
which previously had two hand-rolled helpers for exactly this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// before
function arrayToStream<T>(array: T[]): ReadableStream<T> {
return new PushReadableStream(async (controller) => {
for (const item of array) {
await controller.enqueue(item);
}
});
}

function concatStreams<T>(...streams: ReadableStream<T>[]): ReadableStream<T> {
return new PushReadableStream(async (controller) => { /* ... */ });
}

// after
/**
* Polyfill for `Iterator.concat()`
*
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/concat
*/
async function* concatIterables<T>(
...iterables: (Iterable<T> | AsyncIterable<T>)[]
): AsyncIterable<T> {
for (const iterable of iterables) {
yield* iterable;
}
}

// ... and at the call site
output: ReadableStream.from(concatIterables(lines, output)),

The comment is explicit that concatIterables is a polyfill for
Iterator.concat() — a Stage 3 proposal that does not exist in any shipping
browser yet, which is why the generator function stays. The important part is
that the scrcpy client’s output stream is now built from an async generator
rather than a PushReadableStream with a manual await controller.enqueue()
loop. The backpressure semantics of PushReadableStream and a generator-backed
ReadableStream differ: the latter lets the stream implementation decide how
much to pull ahead, and ReadableStream.from handles that correctly by
pulling one item at a time.

The Node.js TCP transport stops hand-rolling streams

@yume-chan/adb-server-node-tcp exists to let Node.js code talk to a local
adb server over TCP — useful for the ya-webadb CLI and for any tool that
wants the daemon protocol without WebUSB. Its connector used to bridge
node:net‘s Socket to web streams by hand, with a PushReadableStream,
a pause()/resume() dance around each enqueue(), and a
MaybeConsumable.WritableStream wrapping socket.write().

The new version replaces all of that with node:stream‘s official web-stream
adapters:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { Readable, Writable } from "node:stream";

return {
readable: Readable.toWeb(socket) as never,
writable: new MaybeConsumable.WrapWritableStream<Uint8Array>(
Writable.toWeb(socket) as never,
),
get closed() {
return closedResolver.promise;
},
close() {
socket.end();
},
};

The as never casts are ugly but honest: Readable.toWeb() returns a
ReadableStream<any> from the global scope, and the library’s
ReadableStream type comes from its own stream-extra compatibility layer,
so the two are nominally different types even though they are the same
runtime object.

The listener handling was also cleaned up. The old code attached a close
listener that resolved a promise and left it attached forever; the new code
uses a PromiseResolver plus an explicit cleanup() that removes the
listeners:

1
2
3
4
5
6
7
8
9
10
11
12
13
const handleClose = () => {
closedResolver.resolve(undefined);
cleanup();
};
const handleError = (e: Error) => {
closedResolver.reject(e);
cleanup();
};

const cleanup = () => {
socket.removeListener("close", handleClose);
socket.removeListener("error", handleError);
};

Note that handleError now rejects the closed promise where the old
code’s closed promise only ever resolved. A rejected closed promise that
nobody awaits is exactly the kind of thing that produces an
UnhandledPromiseRejection crash in Node — which is why the very next line
is:

1
suppressUnhandledRejection(closedResolver.promise);

That helper and its companion noop are the subject of the next section,
because they are what the rest of this refactor is built on.

noop and suppressUnhandledRejection: two helpers, six call sites

The new helpers come from @yume-chan/async 4.2.2, and their implementations
are almost comically small:

1
2
3
4
5
6
7
// no-op.js
export function noop() {}

// suppress-unhandled-rejection.js
export function suppressUnhandledRejection(promise) {
promise.catch(noop);
}

suppressUnhandledRejection is promise.catch(noop) with a doc comment and
an ESLint-disabling intent. The value is not the code — it is that the
intent becomes greppable and that the ESLint no-floating-promises rule
is satisfied without a // eslint-disable-next-line on every line.

The library previously had its own NOOP constant in
libraries/adb/src/utils/no-op.ts, marked /* #__NO_SIDE_EFFECTS__ */ for a
side-effect-detection toolchain that has since been removed. This PR deletes
that file and switches every call site to the @yume-chan/async versions.

The call sites that changed:

  • libraries/adb/src/service/sync/compression/native.ts —
    stream.writable.abort().catch(NOOP) → .catch(noop)
  • libraries/adb/src/service/sync/request/push.ts — this.#resolver.promise.catch(NOOP)
    → suppressUnhandledRejection(this.#resolver.promise)
  • libraries/stream-extra/src/consumable/writable.ts —
    void consumable.consumed.catch(() => {}) → suppressUnhandledRejection(consumable.consumed)
  • libraries/stream-extra/src/delayed-close-writable.ts — same substitution
  • libraries/stream-extra/src/task-queue.ts — same substitution
  • libraries/scrcpy/src/control/writer.ts — suppressUnhandledRejection(result[1])
  • libraries/adb-server-node-tcp/src/connector.ts — as above

One of these is worth singling out, because it is a direct follow-on from
yesterday’s post. ConsumableWritableStream.write is exactly the method that
PR
#878
(ac8447b3, “fix(stream-extra): prevent unhandled rejection in
Consumable.WritableStream.write”
) fixed. This PR does not change the
behaviour — it changes the spelling of the fix, moving the
catch(() => {}) into the shared helper. That is the natural follow-through
after a fix like that lands: the first commit patches one call site, the
second commit notices the same pattern in five other places and gives it a
name.

logcat arguments are validated before they reach the device

The last substantive change is in
libraries/android-bin/src/logcat.ts,
and it is the kind of fix that only shows up in a code review.

The Logcat.binary() method builds a logcat command line. Previously it
used truthiness checks:

1
2
3
if (options?.pid) {
args.push("--pid", options.pid.toString());
}

options.pid = 0 is falsy, so it was silently dropped — a request to filter
by PID 0 (which on Linux means “the kernel’s scheduler thread group”, a real
thing on Android) would produce a logcat invocation with no --pid filter
at all, and you would get every log line from every process with no
indication that anything went wrong. The new code is explicit:

1
2
3
4
5
6
if (options.pid !== undefined) {
if (!Number.isSafeInteger(options.pid) || options.pid <= 0) {
throw new Error("PID must be a positive integer");
}
args.push("--pid", options.pid.toString());
}

The same treatment for tail:

1
2
3
4
5
6
7
8
if (typeof options.tail === "number") {
if (!Number.isSafeInteger(options.tail) || options.tail <= 0) {
throw new Error("Tail must be a positive integer");
}
args.push("-t", options.tail.toString());
} else if (options.tail) {
args.push("-t", formatTailTime(options.tail));
}

Note the restructuring: the tail branch moved out of the if (options)
block, because options.tail is meaningful even when options is otherwise
falsy-ish. And the typeof === "number" check now runs before the truthiness
check, so tail: 0 throws instead of falling through to the “no tail
argument” case.

Logcat.logIdToName() had a related problem — LogIdName[id]! used a
non-null assertion to silence TypeScript about the record lookup, which would
return undefined at runtime for an unknown id:

1
2
3
4
5
6
7
static logIdToName(id: LogId): string {
const value = LogIdName[id];
if (!value) {
throw new Error(`Unknown LogId: ${id}`);
}
return value;
}

And in the scrcpy clipboard code,
libraries/scrcpy/src/1_21/impl/set-clipboard.ts,
a resolver.reject() with no argument became a real error:

1
2
3
4
5
6
7
8
9
close(): void {
for (const resolver of this.#resolvers.values()) {
resolver.reject(
new Error("Control socket closed before acknowledgment"),
);
}
this.#resolvers.clear();
this.#closed = true;
}

Rejecting with undefined produces a rejection whose reason is undefined,
which is much harder to debug than a message — you get Unhandled rejection (undefined) in the console and nothing else.

Two smaller fixes worth noting

IPv6 bracket parsing. In
libraries/adb-server-node-tcp/src/socket-spec.ts, the bracketed-IPv6 branch
shadowed the outer port variable with a const:

1
2
3
4
// before
const port = decimalToNumber(spec, end + 2);
// after
port = decimalToNumber(spec, end + 2);

The outer port was later unconditionally reset with port = undefined; —
which was fine in the old code because the bracket branch returned early, but
would have been a bug if the flow ever changed. The change removes the
shadowing and the reset. The parser is a port of AOSP’s
socket_spec.cpp / parsenetaddress.cpp, and the file carries the
cs.android.com permalinks so the two can be diffed.

WrapWritableStream.bePipedThroughFrom is gone. This method was removed
from libraries/stream-extra/src/wrap-writable.ts without a replacement. If
you were using it, you now write the equivalent by hand:

1
2
3
4
5
6
7
8
9
10
11
12
13
// the removed method
bePipedThroughFrom<U>(transformer: TransformStream<U, T>) {
let promise: Promise<void>;
return new WrapWritableStream<U>({
start: () => {
promise = transformer.readable.pipeTo(this);
return transformer.writable;
},
async close() {
await promise;
},
});
}

There is one more change in the diff that is easy to miss and worth
understanding, because it is not a code change at all — it is a metadata
change in pnpm-workspace.yaml:

1
2
minimumReleaseAgeExclude:
- "@yume-chan/async@4.2.2"

pnpm’s minimumReleaseAge setting refuses to install packages published
more recently than some threshold, which is a supply-chain hardening measure
against compromised fresh releases. The exception list carves out
@yume-chan/async@4.2.2 specifically — the author needed the brand-new
version and did not want to wait out the delay. It is a small, honest piece
of metadata: it says “this one release was published hours ago and we took it
anyway”.

What this means for webadb.online

Mostly this is upstream work with no direct impact on webadb this week, with
one exception worth flagging.

No impact on webadb this week. webadb.online is still on
@yume-chan/adb@3.0.0-beta.1 and the whole 3.0.0-beta.1 line, and this
PR is unreleased — it landed on main after the v3.0.0-beta.4 tag
(7bcec613, October 9), so there is no npm artifact to consume yet. The
changes that would reach us via a future beta are the socket CLOSE packet
and the ReadableStream.from sync-iterator split.

The CLOSE packet is the one with a plausible user-visible effect. Our
Terminal panel creates a PTY per window; when a window is closed, the PTY is
torn down and the underlying ADB socket is cancelled. On the current
3.0.0-beta.1, that cancellation does not tell adbd anything, so the device
keeps the shell: socket alive until the whole USB transport goes away.
On a phone where the user opens and closes several Terminal windows in a
row, that is a slow accumulation of orphaned sockets on the device side.
Upgrading to a release containing 0c68ad2f would make our teardown
explicit and bounded.

The logcat argument validation is not directly useful to us either — our
Logcat panel builds its own logcat command line rather than going through
@yume-chan/android-bin‘s Logcat class — but the options.pid !== undefined
fix is a good reminder for our own shell-out code, where we do pass --pid
values that come from a UI filter and could legitimately be 0.

The ReadableStream.from sync-path split is the one change that might make
itself felt without a version bump, because it lands in stream-extra, which
we do depend on at ^3.0.0-beta.1 and which is a separate npm package with
its own version line. But we do not currently call ReadableStream.from with
a synchronous iterable anywhere in our own code — I checked — so the practical
benefit for us is zero today. It would matter if we adopted it.

One process note: the Chromium Direct Sockets check that runs on Mondays was
skipped this week. Today is Thursday, and that source is weekly by design.

pm install -S streams the APK, and the package name comes out of the manifest

Four commits landed yesterday in webadb.online, and together they amount to one uncomfortable lesson: pm install reporting Success proves nothing, and neither does the shell command’s exit code. The APK installer now streams the APK into pm over the shell protocol’s stdin, and it reads the package name straight out of the APK’s binary AndroidManifest.xml in the browser — because there is no reliable device-side tool that can tell you what you just installed.

Along the way we also found and fixed a decoding bug that was silently turning every successful pm install into an apparent failure.

The bug that started it: Success is not proof

The original installer did the obvious thing: push the APK to /data/local/tmp/, then run pm install <path> and show whatever came back. pm printed Success, and the panel reported Success to the user.

It was installing nothing.

The path form of pm install asks PackageManager — which runs as system_server, a different process with a different SELinux domain — to open the file itself. That read is subject to SELinux policy and to the file’s ownership and context. When it silently yields nothing, PackageManager can print Success while installing nothing at all.

This is not a bug in the sense of “someone forgot to handle it.” It is documented behaviour. Google’s own guidance on this is issue 80270303, closed as “Intended Behavior”, and the supported install forms are:

  1. Host-side adb install, which streams the file using the install-write / install-commit sync commands.
  2. On-device cat file.apk | pm install -S <size>.

We cannot use form 1 — there is no adb install binary in the browser; the ADB protocol is spoken directly over WebUSB. But form 2 is reachable, and it is reachable precisely because ya-webadb’s shell protocol exposes a writable stdin stream.

Streaming the APK into pm over stdin

The change in components/ApkInstallPanel.tsx (commit 222db08) is to spawn pm with a byte count and write the APK into its stdin:

1
2
3
4
5
6
const apkSize = buf.byteLength;
const streamingArgs = [
"pm", "install",
"-S", String(apkSize),
"-r", "-t", "-d", "-g",
];

-S <n> tells pm to expect exactly n bytes on stdin. The bytes themselves go through the shell protocol’s stdin stream:

1
2
3
4
5
6
const spawnPromise = shell.spawn(streamingArgs);
const proc = await spawnPromise;
const writer = proc.stdin.getWriter();
await writer.write(buf);
await writer.close();
const streamResult = await spawnPromise.wait().toString();

The critical structural detail is that shell.spawn() returns a lazy promise that is both the process and a Wait helper. Awaiting it yields an AdbShellProtocolProcess with a .stdin stream; .wait() on the same promise yields the exit code and output. You have to hold the promise to use both:

1
2
3
const spawnPromise = shell.spawn(streamingArgs);
const proc = await spawnPromise; // .stdin
const streamResult = await spawnPromise.wait().toString(); // .stdout/.stderr/.exitCode

Why streaming matters here, concretely: the bytes never touch the filesystem as far as PackageManager is concerned. No cross-process file-open permission is required, no path parsing happens, and there is no ambiguity about whether the staged file was truncated. The path form is retained as a fallback for OEM builds that only accept it, and the panel reports both results if the streaming form fails and the fallback also fails.

The -r -t -d -g flags deserve a note: -r allows replacement of an existing install, -t allows test-only packages, -d allows version-code downgrades, -g grants all runtime permissions at install time. A follow-up commit (a249f5e) removed --user 0, which was pinning the install to the primary user — the default anyway — and made the command line longer than it needed to be.

Verifying the install instead of trusting the message

Even pm install -S printing Success is not proof. So the panel now looks the package up afterwards:

1
2
3
4
5
const list = await shell
.spawn(["pm", "list", "packages", pkgName])
.wait()
.toString();
verified = (list.stdout ?? "").includes(pkgName);

Which immediately exposes the next problem: where does pkgName come from? The panel had been deriving it by taking the staged APK’s filename stem and grepping pm list packages -f output for it. That can never succeed, and the reason is worth writing down because it is a genuinely surprising property of Android’s package installation:

After installation, PackageManager renames the APK to base.apk under /data/app/<random>/<pkg>-<hash>/. The original filename appears nowhere in the installed path.

So the heuristic always returned null, and the panel always fell into the “package NOT found” branch — reporting a failure for an install that had in fact succeeded. Commit 441fb31 fixed it by reading the real package name out of the APK.

The three candidate sources for a package name, and why the first two fail:

Source Why it fails
aapt2 dump badging Absent from many OEM ROMs (MIUI/HyperOS, ColorOS, OneUI). On stock AOSP it lives at /system/bin/aapt2, outside the default shell PATH.
pm list packages -f The installed APK is renamed to base.apk; the original filename is not in the path.
Parse AndroidManifest.xml Always present, always in the APK, parseable in the browser.

Parsing Android binary XML in the browser

AndroidManifest.xml inside an APK is not XML. It is AXML (Android binary XML): a chunked binary format that Android’s resource system uses so that the manifest can be read on-device without a full XML parser.

lib/apk-package-name.ts (393 lines) implements a small AXML reader. The layout it relies on, all little-endian:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
0x0000  u32  magic          = 0x00080003 (RES_XML_TYPE)
0x0004 u32 fileSize
0x0008 u32 stringPoolType = 0x0001 (RES_STRING_POOL_TYPE)
...
string pool header:
u32 type = 0x0001
u32 headerSize
u32 chunkSize
u32 stringCount
u32 styleCount
u32 flags (1 = UTF-8, 0 = UTF-16)
u32 stringsStart (offset from the start of the string pool chunk)
u32 stylesStart
u32 stringOffsets[stringCount]

The package name is the value of the package attribute on the root <manifest> element. Attribute values in AXML are encoded as a typed Res_value:

1
u16 size, u8 res0, u8 dataType, u32 data

where dataType == 0x03 (TYPE_STRING) means data is an index into the string pool, and dataType == 0x01 (TYPE_INT) means it is a literal integer. The package attribute is always a string, so only the 0x03 case matters — but the structure still has to be parsed properly to know which attribute you are looking at.

The parser walks the string pool (handling both the UTF-8 and UTF-16 variants, whose length-prefix encodings differ — UTF-8 has two variable-length prefixes, one for characters and one for bytes; UTF-16 has a u16 character count with a possible high-bit extension), then walks the chunk list to the RES_XML_START_ELEMENT_TYPE (0x0102) chunk for the root node, then reads the attribute list and returns the value whose name is package.

Because the parser does not resolve namespace URIs against the resource table, it matches on the raw name string. "package" is unique enough in practice, and if the string pool does not contain it, there is a fallback: scan every string in the pool for something that looks like a dotted package name.

Locating the manifest inside the ZIP

AndroidManifest.xml is not necessarily at the start of the APK, so it has to be found. The tempting shortcut is to scan the APK bytes for the AXML magic 0x00080003 — and the code comments explain why that is wrong:

The naive “find the AXML magic anywhere” shortcut produces false positives from compressed data.

A deflate-compressed blob can contain those four bytes by chance, so a magic-byte scan will happily return a chunk of someone else’s compressed data. Instead, the code walks the ZIP central directory properly:

1
2
3
4
5
6
7
8
9
10
// Find the End Of Central Directory record by scanning backwards.
const maxBack = Math.min(zip.length, 66000);
let eocd = -1;
for (let i = zip.length - 22; i >= zip.length - maxBack && i >= 0; i--) {
if (view.getUint32(i, true) === 0x06054b50) { eocd = i; break; }
}
if (eocd < 0) return null;

const cdOffset = view.getUint32(eocd + 16, true);
const cdCount = view.getUint32(eocd + 10, true);

0x06054b50 is the End Of Central Directory signature; 0x02014b50 is the central directory file header signature. The EOCD is found by scanning backwards up to 66,000 bytes — the maximum ZIP comment length is 65,535 bytes, plus the 22-byte EOCD record itself, so the bound is correct rather than arbitrary.

Once the central directory entry for AndroidManifest.xml is found, its local header offset is used to locate the local file header, and the data start is computed from the two length fields:

1
2
3
4
const nameLen  = view.getUint16(localOffset + 26, true);
const extraLen = view.getUint16(localOffset + 28, true);
const dataStart = localOffset + 30 + nameLen + extraLen;
const method = view.getUint16(localOffset + 8, true); // 0 = stored, 8 = deflate

Inflation with DecompressionStream

Most APKs store AndroidManifest.xml deflate-compressed (method 8). The browser has a built-in inflater, and it needs the raw deflate variant — the "deflate" format in the Compression Streams API expects a zlib header, which ZIP does not have:

1
2
3
4
5
const ds = new DecompressionStream("deflate-raw");
const writer = ds.writable.getWriter();
void writer.write(raw as unknown as BufferSource);
void writer.close();
const reader = ds.readable.getReader();

Because DecompressionStream is async, the module exports two functions: a synchronous extractPackageNameFromApk() that handles only stored (method 0) manifests, and an async extractPackageNameFromApkAsync() that inflates first and then delegates to the same manifest parser. The panel uses the async one.

The test

lib/apk-package-name.test.ts hand-builds a synthetic AXML with a known package name — a UTF-16 string pool chunk followed by a start-element chunk carrying the package attribute — and asserts the parser finds it. It is wired up as npm test:

1
2
3
$ npm test
> tsx lib/apk-package-name.test.ts
PASS — extracted "com.xiuxin.glassoptimizer"

Hand-built fixtures rather than a checked-in APK: it keeps the test hermetic, it runs in about a second, and it pins the exact byte layout the parser expects — which is the thing most likely to rot.

The decoding bug: wait().toString() vs stdout.toString()

The second half of yesterday’s work is a bug that predates the APK installer and infected three panels.

ya-webadb’s shell spawner returns a lazy promise with two result shapes:

  • await proc.wait() → WaitResult<Uint8Array> — result.stdout is a raw Uint8Array
  • await proc.wait().toString() → WaitResult<string> — result.stdout is a decoded UTF-8 string

The footgun is that Uint8Array.prototype.toString() is not a decoder. It returns the byte values as a comma-separated list of decimals. The installer was reporting failures like this:

1
2
pm install failed (exit 0)
83,117,99,99,101,115,115,10

Decode those and you get Success\n. The install had succeeded the whole time. The panel was manufacturing a failure out of a successful operation, in a way that looked exactly like a device-side problem.

Commit 8566a80 fixed three call sites:

  • components/ApkInstallPanel.tsx — install, minimal-retry, ls -lZ, and pm install --help now all go through .wait().toString()
  • components/ClipboardPanel.tsx — clipboard write attempts read stdout/stderr through .wait().toString(), so error messages are readable instead of byte-value soup
  • components/ShellPanel.tsx — the stat output in infoEntry was printing 114,111,111,116,... instead of the stat listing

The fix in each case is the same shape:

1
2
3
4
5
6
7
// ❌ before — invokes Uint8Array.prototype.toString()
const waitResult = await r.wait();
const stdout = await waitResult.stdout.toString();

// ✅ after — decodes UTF-8
const waitResult = await r.wait().toString();
const stdout = waitResult.stdout ?? "";

Three sites were deliberately left alone, and the reasoning matters more than the fix:

  • shell.spawn([...]).wait() used purely for completion (the screencast panel’s rm -f) — no output is consumed, so decoding is irrelevant
  • pipeline.ts‘s raw ReadableStream reads — those carry binary MP4 bytes and must not be decoded
  • lib/adb-client.ts‘s spawnBinary() — explicitly wants raw bytes

The general rule: the decoding boundary is the call site, and you have to know whether you are holding text or bytes before you call .toString() on it.

Diagnostics you can run by hand

Commit 222db08 also added four entries to the Shell panel’s default command list, so this failure mode is inspectable without a debugger:

1
2
3
4
pm install flags       →  pm install --help 2>&1 | head -n 40
Staged APKs in /tmp → ls -l /data/local/tmp/*.apk 2>&1
Check staged APK size → ls -l /data/local/tmp/<file>.apk; stat -c %s <file>.apk
Is app installed? → pm list packages | grep -i <pkg>

The third one is the discriminator that matters: if stat reports fewer bytes than the file you picked, the sync.write transfer was cut short — a transport problem, not a bad APK. The first one exists because the supported pm install flag set varies across Android versions and OEM skins, and reading the device’s own --help beats guessing.

The panel also dumps pm install --help once per session and attaches the output to any failure, so the user can see exactly which flags their build accepts without leaving the app.

What this means for webadb.online

Yesterday’s work is a good illustration of why browser-side ADB needs more than a thin protocol wrapper. pm install is not a command with a documented, stable contract — it is a command whose success signal is unreliable, whose failure mode is device-policy-dependent, and whose most useful diagnostic (the installed package name) is not available from any device-side tool that is consistently present. Working around that meant writing an AXML parser and a ZIP central-directory walker in the browser, which is exactly the kind of thing the project exists to do.

Nothing upstream changed: yume-chan/ya-webadb has been quiet since v3.0.0-beta.5 on 2026-11-06 (d22e9dc3c9d53178f4cf88cd757253f7ce780b10), which this blog covered on November 7. The Chrome Direct Sockets check is skipped — that one runs Mondays. All four of yesterday’s commits are local to webadb.online, and all four are fixes to the APK installer and the shell-output decoding that the installer depended on.

Chrome 159 branches, and the WebTransport spec rewrites itself underneath

Chrome 159 branched to Beta yesterday, which freezes the WebTransport wave this blog has been tracking since Nov 8 into a shippable milestone. Twenty-two hours before that branch, the W3C WebTransport Working Group’s GitHub repository received fourteen new pull requests inside a twenty-three-minute window — and in the week before it, the group’s spec editor merged four normative changes that Chromium has not implemented. The branch and the churn are the same story seen from two ends: 159 locks in what exists, while the spec underneath it is still deciding what the next milestone should even mean.

The branch: M159 is now real

The Chrome milestone schedule for M159 was unusually compressed. Branch point and feature freeze both landed on November 9, earliest beta November 11, final beta cut November 18, early stable November 18, stable December 8. That is a three-week gap between beta and stable, which is the holiday stretch the release calendar normally absorbs by giving a milestone more room. Chrome 158 went stable the same week it was supposed to branch into beta, so the two milestones are overlapping in a way that makes the beta channel the only place to test anything new.

The branch itself is visible in Chromium’s own infrastructure. The projects/chromium-m159 config set on LUCI points at revision 84480ae178055411e6bc73507798a597178cd51a, committed 2026-11-10 15:15:47 UTC by chrome-branch-day@chops-service-accounts.iam.gserviceaccount.com — the bot that cuts release branches. The first tag on that head, 159.0.8152.0, was created on November 9, 2026 with Cr-Branched-From: refs/heads/main@{#1737478}, and the branch-head config file chrome_branch_deps.json for branch 8152 follows from the same main position.

So the ordering is: feature freeze and branch point on Nov 9, the chrome-branch-day branch head cut on Nov 10, beta builds going out on Nov 11. Whatever was in main at {#1737478} is what Chrome 159 is.

What that means concretely: as of yesterday, the twenty features enabled by default in Chrome 159 are frozen. The list includes seven WebTransport entries, and this blog has already covered the two most consequential ones in detail — the datagram writable streams with sendGroup / sendOrder prioritization and the getStats() implementation that ships five of the spec’s thirteen dictionary members.

What has not been covered is the thing that will determine whether Chrome 160 is a drop-in replacement for Chrome 159, or a different API. Between Nov 3 and Nov 11 the specification changed in four places that alter observable behaviour.

The spec editor merged four normative changes in one hour

Jan-ivar, who chairs the WebTransport Working Group and edits the spec, opened four pull requests against w3c/webtransport on the evening of November 3 and merged all four within roughly an hour on November 4. Each one closed an issue filed earlier that October, and each one is a behaviour change rather than an editorial cleanup.

outgoingMaxAge is now non-nullable and defaults to Infinity

PR #813, closing issue #807, changes the IDL:

1
2
-  attribute unrestricted double? outgoingMaxAge;
+ attribute unrestricted double outgoingMaxAge;

and the corresponding internal slot from null-able to a plain double, with the initial value changing from null to Infinity. The writeDatagrams algorithm also loses its implementation-defined fallback:

1
-  1. If |duration| is null, then set |duration| to an [=implementation-defined=] value.

The rationale is that null was never a meaningful state. An application setting outgoingMaxAge = null either meant “never expire” or meant “use whatever the UA picked”, and the second reading made the attribute untestable. Infinity is the same thing but says it out loud.

This is the change with the longest tail, because Chromium has not caught up. Chromium’s WebTransportDatagramDuplexStream::setOutgoingMaxAge() still takes a std::optional<double>, and null is still the IDL type in the shipped implementation. An application written against the new spec that does wt.datagrams.outgoingMaxAge = Infinity will work today, but an application that reads the attribute back and compares against null will behave differently once Chromium implements the change. The WebKit implementation carries the same std::optional shape.

The user agent can now cap the datagram send queue by bytes

PR #815, closing issue #806, adds a new normative concept — send queue is full — that can be triggered by a byte limit as well as by the existing datagram-count limit:

1
2
3
4
5
6
7
8
+ A {{WebTransportDatagramsWritable}} |writable|'s
+ <dfn for="WebTransportDatagramsWritable">send queue is full</dfn> if either of the following is
+ true:
+
+ * The length of |writable|.{{[[OutgoingDatagramsQueue]]}} is not less than
+ |writable|.{{WebTransportDatagramsWritable/[[Transport]]}}.{{[[Datagrams]]}}.{{[[OutgoingMaxBufferedDatagrams]]}}.
+ * The total byte length of the datagrams in |writable|.{{[[OutgoingDatagramsQueue]]}} is greater
+ than an [=implementation-defined=] positive byte limit.

The note attached to it explains the intent: the byte limit lets the user agent cap memory in the underlying sink regardless of outgoingMaxBufferedDatagrams, and datagrams beyond it wait in the WritableStream‘s own queue rather than in the sink’s.

This is the single most consequential change in the batch for anyone who writes datagram-heavy code, because it changes the shape of backpressure. The existing Chromium implementation of WebTransportDatagramDuplexStream.createWritable() — commit ff66885fb0d785437f82f9ab7aaedd3d3dcc8812, “WebTransport: Implement Datagram writable streams” — gates the API behind an experimental runtime feature and deliberately leaves the priority plumbing to a follow-up CL:

This CL stores and validates sendGroup/sendOrder; plumbing those priorities through Mojo and the network service is intentionally left to a follow-up CL.

So the send-group prioritization that Chrome 159 ships is, at the Chromium level, currently a value that gets stored and validated but not yet honoured end-to-end. The Nov 9 post covered the API surface landing; this is the reminder that the surface and the semantics are two different milestones.

getStats() members are now chosen once per session, not per call

PR #814, closing issue #808, replaces the phrase “the user agent wishes to expose” with a defined term, chooses to expose:

1
2
3
4
-A user agent can withhold stats members, e.g. for privacy. It
-<dfn>chooses to expose</dfn> a stats [=dictionary member=] if it makes this
-choice once per [=WebTransport session=], not per call. So a member present in
-one `getStats()` result won't disappear from later results in the same session.

The problem it solves is real and was reported against Chromium: a member could show up in one getStats() result and be missing from the next, with no way for the application to tell “the UA chose to withhold this” from “this field does not exist yet”. The fix makes the choice stable for the lifetime of the session.

The same change applies to WebTransportSendStream.getStats(), WebTransportSendGroup.getStats() and WebTransportReceiveStream.getStats() — all four sites in the spec now say “chooses to expose” rather than “wishes to expose”.

Datagram reception moves to in-parallel processing

PR #812 is the smallest of the four, and the most consequential for anyone benchmarking:

1
2
-  1. Let |datagram| be the result of [=session/receiving a datagram=] with |session|.
+ 1. Let |datagram| be the result of [=session/receiving a datagram=] with |session| [=in parallel=].

One keyword. The receiveDatagrams loop now pulls each datagram concurrently rather than one-at-a-time, which is what makes a high-rate datagram stream actually saturate a link instead of running at one-message-per-round-trip.

The specification is being rewritten by a newcomer, in bulk

The most striking thing in the repository this week is not the four merges. It is what happened on November 11.

Between 00:53:31Z and 01:16:57Z — twenty-three minutes and twenty-six seconds — fourteen pull requests were opened against w3c/webtransport by a single account, JinDX. They are, in order:

PR Title
#819 Serialize WebTransport datagram send passes for each writable
#820 Restore the WebTransport stream error code during deserialization
#821 Snapshot WebTransport TLS exporter label and context bytes
#822 Forward the write chunk to writeDatagrams
#823 Use the transport argument in the fetch response assertion
#824 Return the rejected promise from getStats() for failed transports
#825 Preserve the pending atomic writes when clearing the slot
#826 Use the same WebTransport object for construction and Fetch
#827 Use the BufferSource byte length for the datagram size check
#828 Compare the reserved WebTransport header as bytes
#829 Track closing send streams until their data is committed
#830 Bind the datagram duplex stream in receiveDatagrams
#831 Pass send group and send order through bidirectional stream creation
#832 Read the attached stream in WebTransportWriter.commit()

A fifteenth PR arrived later the same day from a different author: #833, “Pass an origin instead of a URL to ‘obtain a connection’”, opened at 11:11:03Z by noamr (Noam Ravid), following whatwg/fetch#1968. That one was closed at 17:32:53Z the same day, with Annevk (Anne van Kesteren) commenting:

@noamr confirmed PAC still needs this at least in Chrome so I recommend closing this.

The account is new to the project. JinDX — 金东勋 / 김동훈 / Jin Dongxun — has a GitHub account created in 2011 and 166 public repositories, and its only prior contribution to w3c/webtransport was PR #810, “Remove duplicated articles from WebTransport statistics steps”, which merged on November 3 and was the setup commit for jan-ivar’s four PRs the same evening.

These are not typo fixes. Read the diffs:

#819 adds a new MUST that serializes the send passes per writable:

1
2
3
+For each writable, the user agent MUST complete an invocation's parallel steps and
+all of its queued [=dequeue outgoing datagrams=] tasks before starting another
+invocation of [=sendDatagrams=] for that writable.

#831 changes the internal-slot signature of WebTransportBidirectionalStream creation so that a sendGroup is threaded through, not just a sendOrder:

1
2
3
4
-To <dfn for=BidirectionalStream>create</dfn> a {{WebTransportBidirectionalStream}} with a
-... a |sendOrder|, run these steps.
+To <dfn for=BidirectionalStream>create</dfn> a {{WebTransportBidirectionalStream}} with a
+... a |sendGroup|, and a |sendOrder|, run these steps.

#824 changes what getStats() returns when the transport has already failed — from “abort these steps” to “return the promise”:

1
2
3
4
-  1. If |transport|.{{[[State]]}} is `"failed"`, [=reject=] |p| with an
- {{InvalidStateError}} and abort these steps.
+ 1. If |transport|.{{[[State]]}} is `"failed"`, [=reject=] |p| with an
+ {{InvalidStateError}} and return |p|.

That last one is a genuine spec bug fix: the old text rejected a promise and then aborted, which meant the algorithm returned undefined where the caller expected a promise — so await transport.getStats() on a failed transport would have resolved with undefined instead of throwing.

#830 binds the datagram duplex stream inside receiveDatagrams, and #828 changes the reserved-header comparison to operate on bytes rather than on a string, which is the kind of detail that turns a header check from a locale-dependent comparison into a byte-exact one.

All fourteen are still open, and — as of this writing — none has received a single review. GitHub’s pull-request list shows a 1/2 counter next to each, but that is a reaction count, not a review state: the reviews array on every one of them is empty, and the reviewDecision field is blank. That is worth stating plainly, because a batch of fourteen normative changes sitting unreviewed in a W3C specification repository is a queue, not a roadmap. None of it is merged, and the spec editor has not signed off on any of it.

That is also what makes the batch interesting to watch rather than to act on. The diffs are substantive and mostly correct — #824 in particular fixes a real spec bug — but “correct” and “will land” are different claims. For now they are sitting in the queue that might define Chrome 160.

Three more PRs from the spec editor, and the question they raise

Between Nov 9 and Nov 11, jan-ivar opened three more:

  • #817, “Validate options.headers next to protocols in constructor” (Nov 9)
  • #818, “Don’t create incoming streams after cleanup” (Nov 10)
  • #816, “Add WebTransport datagram concept” (Nov 4) — still open, fixes #793

#818 is the one worth reading closely, because it is a race that any application draining incomingBidirectionalStreams can hit:

1
2
3
4
  1. [=Queue a network task=] with |transport| to run these steps:
+ 1. If |transport|.{{[[State]]}} is `"closed"` or `"failed"`,
+ [=reject=] |p| with an {{InvalidStateError}} and abort these steps.
1. Let |stream| be the result of [=BidirectionalStream/creating=] a

The window it closes is real: a stream arrives from the network, the application is scheduled to handle it, the transport closes in between, and the stream gets enqueued into a closed transport’s IncomingBidirectionalStreams — where it will never be read and never be cleaned up. The same guard is added to the unidirectional path.

And there is an open issue, #811, from Vasil Vasylyev, that reads like a note from someone who ships QUIC:

“Background” CCs like LEDBAT allow applications to send traffic that will proactively “yield” to other traffic on the network; I have had mobile app developers request this one for native QUIC libraries before, so I do wonder if we should add this as an option.

Chrome 159 ships WebTransport.congestionControl with three values — default, throughput, low-latency. A background mode would let an application mark its own traffic as yieldable, which is exactly the property you want for a device-management protocol that must not interfere with whatever else the network is carrying.

Why the timing matters

There is a structural reason these two events landed on adjacent days.

Chrome’s milestone process freezes the implementation at feature freeze. A CL that lands after the branch point is not in Chrome 159 — it is in Chrome 160, and it must satisfy the spec as it stands when the CL lands. The four normative changes merged on Nov 4 are now the spec that any Chromium CL touching outgoingMaxAge, datagram backpressure, or getStats() visibility must implement.

That means the Chrome 159 WebTransport surface — the one this blog has spent three posts describing — is going to be revised in Chrome 160, and in ways that are visible to application code:

  • outgoingMaxAge changes type, from double? to double, with a different default.
  • The datagram send queue can now report “full” for byte reasons, which changes when WritableStream backpressure fires.
  • getStats() member presence becomes stable within a session, which changes what an application can cache.
  • Datagram reception becomes concurrent, which changes throughput characteristics.

None of these is a breaking change in the usual sense. They are changes in observable timing and defaults — the category of change that breaks code which was written against the old behaviour and tested against it.

There is also a parallel thread: w3c/webtransport PR #809, “Assert reliance on fetch partitioning before pooling”, merged on Nov 4, adds an assertion to the obtain a WebTransport connection algorithm:

1
2
3
4
5
+  1. Assert: |newConnection| is not "`no`", or |networkPartitionKey|[1] is neither
+ null nor a fixed value.
+
+ Issue: Fetch currently allows |networkPartitionKey|[1] to be null. See
+ <a href="https://github.com/whatwg/fetch/issues/1926">whatwg/fetch#1926</a>.

That is the pooling-privacy question: whether two WebTransport sessions to the same origin can share one underlying connection. It is unresolved, and the same question came up in a different form on Nov 11 in PR #833 (“Pass an origin instead of a URL to ‘obtain a connection’”), which was opened and closed the same day because Chrome’s Private Access Controls still need the URL form.

What this means for webadb.online

No direct impact on webadb this week — the webadb side of the project did not ship anything new in the last 24 hours beyond yesterday’s pm install -S work, and ya-webadb upstream has been quiet since v3.0.0-beta.5 on November 6.

The relevance is forward-looking and narrow. webadb’s ADB transport runs over WebUSB, not WebTransport, so none of these changes touch the core path. But the ADB protocol is a stream protocol with a request/response discipline, and the shape of the stream API is exactly what is being rewritten underneath Chrome 159:

  • If you are running an ADB-over-WebTransport experiment (WebTransport to a TCP bridge in front of adbd), then the outgoingMaxAge type change and the byte-based send-queue cap are both things you will hit when Chrome 160 lands, because they change when backpressure fires on a stream you are writing into.
  • The getStats() stability guarantee is what you would want before writing any telemetry that samples connection health over a session — before this change, a member could vanish between two calls in the same session and your sampler would have to treat “missing” as “unknown” forever.
  • The in-parallel datagram reception change is the kind of thing that makes a real-time channel work; if you ever map ADB’s shell: protocol onto datagrams rather than streams, the throughput ceiling moves.

The practical advice is unchanged from the last three posts and is worth restating because the branch just made it concrete: feature-detect, do not version-gate. Chrome 159’s WebTransport API is stable in the sense that it is enabled by default and will not be removed, but four of its behaviours are about to change underneath it. Code that reads datagrams.outgoingMaxAge and compares it to null, or that computes backpressure from outgoingMaxBufferedDatagrams alone, or that re-reads getStats() members every poll, will need revisiting.

Chrome 159 reaches stable on December 8. The spec churn that will define Chrome 160 is already in the repository, twenty-three minutes at a time.