diff --git a/worker.md b/worker.md index f874ff2..67acec5 100644 --- a/worker.md +++ b/worker.md @@ -288,6 +288,24 @@ Or to clear the session: > **Note:** > - The worker should store the session ID for the given subscription and use it in subsequent detection or patch messages as appropriate. If `sessionId` is `null`, the worker should treat the subscription as having no active session. +## Subscription Identifier Format + +The `subscriptionIdentifier` used in all messages is constructed as: + +``` +displayIdentifier;cameraIdentifier +``` + +This uniquely identifies a camera subscription for a specific display. + +### Session ID Association + +When the backend sends a `setSessionId` command, it will only provide the `displayIdentifier` (not the full `subscriptionIdentifier`). + +**Worker Responsibility:** +- The worker must match the `displayIdentifier` to all active subscriptions for that display (i.e., all `subscriptionIdentifier` values that start with `displayIdentifier;`). +- The worker should set or clear the session ID for all matching subscriptions. + ## 6. Example Communication Log This section shows a typical sequence of messages between the backend and the worker. Patch messages are not included, as they are only used when the worker cannot keep up.