From b303f4f84bb6de62f4fd18f087060b33e6c89215 Mon Sep 17 00:00:00 2001 From: Jatin Garg <48029724+jatgarg@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:43:09 -0700 Subject: [PATCH] [main > release/v2int/3.3]: Add requestSocketToken param in join session call (#14584) (#14609) ## Description Add requestSocketToken param in join session call when refreshing. For MSA clients, we need to provide this argument otherwise the request will fail 400 invalid request and the client will get disconnected and need to reconnect. --- .../odsp-driver/src/odspDelayLoadedDeltaStream.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/drivers/odsp-driver/src/odspDelayLoadedDeltaStream.ts b/packages/drivers/odsp-driver/src/odspDelayLoadedDeltaStream.ts index 227d9b632124..e3ce1ba0a3a5 100644 --- a/packages/drivers/odsp-driver/src/odspDelayLoadedDeltaStream.ts +++ b/packages/drivers/odsp-driver/src/odspDelayLoadedDeltaStream.ts @@ -212,11 +212,11 @@ export class OdspDelayLoadedDeltaStream { } } - private async scheduleJoinSessionRefresh(delta: number) { + private async scheduleJoinSessionRefresh(delta: number, requestSocketToken: boolean) { await new Promise((resolve, reject) => { this.joinSessionRefreshTimer = setTimeout(() => { getWithRetryForTokenRefresh(async (options) => { - await this.joinSession(false, options); + await this.joinSession(requestSocketToken, options); resolve(); }).catch((error) => { reject(error); @@ -307,7 +307,10 @@ export class OdspDelayLoadedDeltaStream { refreshAfterDeltaMs: response.refreshAfterDeltaMs, }; if (response.refreshAfterDeltaMs > 0) { - this.scheduleJoinSessionRefresh(response.refreshAfterDeltaMs).catch((error) => { + this.scheduleJoinSessionRefresh( + response.refreshAfterDeltaMs, + requestSocketToken, + ).catch((error) => { const canRetry = canRetryOnError(error); // Only record error event in case it is non retriable. if (!canRetry) {