Skip to content

feat(connector-wake): send a shares_changed frame for the admin kind - #48723

Merged
Jinwoo-H merged 1 commit into
mainfrom
connector-wake-shares-changed
Nov 25, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
connector-wake-shares-changed

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The wake Worker's admin call takes an optional kind. {"hosts":[...],"kind":"shares_changed"} makes each host's ConnectorHost object send the text frame {"type":"shares_changed"} instead of {"type":"wake"}. This is the Worker half of the "your shares changed" push; orca-cloud publishes it.

  • Contract (cloud/packages/connector-contract/src/wake-messages.ts): ConnectorWakeKindSchema (shares_changed only), CONNECTOR_SHARES_CHANGED_FRAME, connectorWakeFrame(kind). The request schema stays .strict(); the only addition is the optional kind.
  • A body without kind sends {"type":"wake"}, exactly as before. Any other kind (or null, or an empty string) gets a 400.
  • Response counts and metrics are unchanged.

Current desktops only act on the exact wake frame. They ignore {"type":"shares_changed"} without polling, so the publisher should send this kind only to desktops that read it.

Pin

Pins don't move in this repo. orca-cloud's cloud/infra/cloudflare/connector-wake/README.md says production deploys only from the orca revision in cloud/connector-wake-source-revision in orca-cloud, so that file has to be bumped there to this PR's merge commit before the deploy.

Testing

  • pnpm test:protocol (local workerd): 21/21 pass, including the new W3 (kind shares_changed → 200 {delivered:1}, and the socket gets exactly {"type":"shares_changed"}) and P5 (unknown kind → 400). W1, W2 and R2 still show that the old body sends exactly {"type":"wake"}.
  • connector-contract vitest: the schema accepts no kind and shares_changed, and rejects wake, '', null and extra fields.
  • Typecheck for connector-wake and connector-contract.

Performance

No new work on the hot path. Picking the frame is one string comparison per object call, and the frame is still a constant string sent once per live socket. Fan-out, object count and keepalive handling (which the runtime answers without waking the object) are unchanged. Admin bodies grow by at most 26 bytes, well under the 256 KB cap.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22

@Jinwoo-H
Jinwoo-H merged commit ac69cbd into main Nov 25, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant