Repository navigation
feat(connector-wake): send a shares_changed frame for the admin kind - #48723
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cloud/packages/connector-contract/src/wake-messages.ts):ConnectorWakeKindSchema(shares_changedonly),CONNECTOR_SHARES_CHANGED_FRAME,connectorWakeFrame(kind). The request schema stays.strict(); the only addition is the optionalkind.kindsends{"type":"wake"}, exactly as before. Any other kind (ornull, or an empty string) gets a 400.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.mdsays production deploys only from the orca revision incloud/connector-wake-source-revisionin 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 (kindshares_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-contractvitest: the schema accepts no kind andshares_changed, and rejectswake,'',nulland extra fields.connector-wakeandconnector-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.