From 0f47e6ea28272e444fe8c26b66ca92187f4d94eb Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Mon, 6 Apr 2026 15:59:22 +0530 Subject: [PATCH] Enhance subscription message documentation for clarity on upsertion behavior --- app/realtime.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/realtime.php b/app/realtime.php index 51ee374e84..2068ae7704 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -962,8 +962,11 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re case 'subscribe': // TODO: record stats /** - * Message based subscription - * to update a query of an existing subscription for channels + * Message based upsertion of a subscription + * If subscriptionId is given then it will match subId of the connection and update the subscription with channels and queries + * If non-existing subid is given or not given a new subid will be generated + * Similar to what we have now -> two subscribe() block with same channels and queries still two different subscriptions + * * structure of the payload -> array of maps * 'data' : [subscriptionId:"" , channels:[] , queries:[]] */