Skip to content

Commit

Permalink
[main > release/v2int/3.3]: Add requestSocketToken param in join sess…
Browse files Browse the repository at this point in the history
…ion 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.
  • Loading branch information
jatgarg authored Mar 16, 2023
1 parent c186480 commit b303f4f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ export class OdspDelayLoadedDeltaStream {
}
}

private async scheduleJoinSessionRefresh(delta: number) {
private async scheduleJoinSessionRefresh(delta: number, requestSocketToken: boolean) {
await new Promise<void>((resolve, reject) => {
this.joinSessionRefreshTimer = setTimeout(() => {
getWithRetryForTokenRefresh(async (options) => {
await this.joinSession(false, options);
await this.joinSession(requestSocketToken, options);
resolve();
}).catch((error) => {
reject(error);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b303f4f

Please sign in to comment.