@webex/plugin-meetings 3.12.0-next.95 → 3.12.0-next.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/locusMediaRequest.js +1 -1
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +14 -14
- package/src/meeting/locusMediaRequest.ts +1 -1
- package/test/unit/spec/meeting/locusMediaRequest.ts +109 -5
|
@@ -191,7 +191,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
|
|
|
191
191
|
method: _constants.HTTP_VERBS.PUT
|
|
192
192
|
});
|
|
193
193
|
},
|
|
194
|
-
version: "3.12.0-next.
|
|
194
|
+
version: "3.12.0-next.97"
|
|
195
195
|
});
|
|
196
196
|
var _default = exports.default = AIEnableRequest;
|
|
197
197
|
//# sourceMappingURL=index.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1133,7 +1133,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1133
1133
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1134
1134
|
}
|
|
1135
1135
|
},
|
|
1136
|
-
version: "3.12.0-next.
|
|
1136
|
+
version: "3.12.0-next.97"
|
|
1137
1137
|
});
|
|
1138
1138
|
var _default = exports.default = Breakouts;
|
|
1139
1139
|
//# sourceMappingURL=index.js.map
|
|
@@ -381,7 +381,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
381
381
|
throw error;
|
|
382
382
|
});
|
|
383
383
|
},
|
|
384
|
-
version: "3.12.0-next.
|
|
384
|
+
version: "3.12.0-next.97"
|
|
385
385
|
});
|
|
386
386
|
var _default = exports.default = SimultaneousInterpretation;
|
|
387
387
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.12.0-next.
|
|
21
|
+
version: "3.12.0-next.97"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|
|
@@ -273,7 +273,7 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
|
|
|
273
273
|
return _regenerator.default.wrap(function (_context) {
|
|
274
274
|
while (1) switch (_context.prev = _context.next) {
|
|
275
275
|
case 0:
|
|
276
|
-
_t = (e === null || e === void 0 ? void 0 : e.statusCode) === 409;
|
|
276
|
+
_t = (e === null || e === void 0 ? void 0 : e.statusCode) === 409 || (e === null || e === void 0 ? void 0 : e.statusCode) === 403;
|
|
277
277
|
if (!_t) {
|
|
278
278
|
_context.next = 2;
|
|
279
279
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","require","_common","_events","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_metrics","_constants2","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","result","forEach","d","resolve","catch","reject","MAX_SELF_URL_RETRY_COUNT","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","config","options","_this2","isRequestInProgress","queuedRequests","confluenceState","_inherits2","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","_sendHttpRequest","_asyncToGenerator2","_regenerator","mark","_callee2","_this4","selfUrlRetryCount","uri","_this$getLatestMuteSt","body","localMedias","upload","download","promise","setupProgressListener","_args2","arguments","_t2","wrap","_context2","prev","next","selfUrl","getCurrentSelfUrl","concat","MEDIA","device","correlationId","respOnlySdp","usingResource","abrupt","reachability","clientMediaPreferences","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","EventEmitter","method","HTTP_VERBS","PUT","_ref","_callee","_t","_context","statusCode","shouldRetryOnSelfUrlChange","sent","sendHttpRequest","webex","internal","newMetrics","submitClientEvent","name","meetingId","rawError","stop","_x2","direction","eventEmitter","on","progressEvent","timeStamp","loaded","total","_x","currentSelfUrl","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","LOCUS_MEDIA_REQUEST_RETRY","correlation_id","reason","_shouldRetryOnSelfUrlChange","_callee3","_request$roapMessage","roapMessageType","latestSelfUrl","_context3","waitForSelfUrlChange","retryAttempt","_x3","_x4","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {EventEmitter} from 'events';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request, 0)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n getCurrentSelfUrl: () => string | undefined;\n waitForSelfUrlChange: () => Promise<void>;\n};\n\nconst MAX_SELF_URL_RETRY_COUNT = 2;\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private async sendHttpRequest(request: Request, selfUrlRetryCount = 0) {\n // Resolve selfUrl lazily at send time. Locus rotates it on session\n // transitions (breakout end, move-to, lobby admit) and the value\n // captured upstream in roap/index.ts may be stale by the time we\n // leave the queue. Persist the resolved URL on the request so a\n // retry can detect a further rotation.\n request.selfUrl = this.getCurrentSelfUrl(request);\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n const upload = new EventEmitter();\n const download = new EventEmitter();\n\n const options = {\n method: HTTP_VERBS.PUT,\n uri,\n body,\n upload,\n download,\n };\n\n // @ts-ignore\n const promise = this.request(options)\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n return result;\n })\n .catch(async (e) => {\n if (\n e?.statusCode === 409 &&\n (await this.shouldRetryOnSelfUrlChange(request, selfUrlRetryCount))\n ) {\n // In-flight race: selfUrl rotated after we left the queue but\n // before Locus rejected the request. Re-send; getCurrentSelfUrl\n // will pick up the new URL. The returned promise replaces the\n // rejection, so the caller's pendingPromise resolves correctly.\n // Advance the retry count here so the guard in\n // shouldRetryOnSelfUrlChange eventually stops after\n // MAX_SELF_URL_RETRY_COUNT attempts.\n return this.sendHttpRequest(request, selfUrlRetryCount + 1);\n }\n\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n\n if (request.type === 'RoapMessage') {\n const setupProgressListener = (direction: string, eventEmitter: EventEmitter) => {\n eventEmitter.on('progress', (progressEvent: ProgressEvent) => {\n LoggerProxy.logger.info(\n `${request.type}: ${direction} Progress, Timestamp: ${progressEvent.timeStamp}, Progress: ${progressEvent.loaded}/${progressEvent.total}`\n );\n });\n };\n\n setupProgressListener('Upload', options.upload);\n setupProgressListener('Download', options.download);\n }\n\n return promise;\n }\n\n /**\n * Returns the latest selfUrl for this meeting, falling back to the value\n * captured when the request was enqueued.\n */\n private getCurrentSelfUrl(request: Request): string {\n const currentSelfUrl = this.config.getCurrentSelfUrl();\n\n if (currentSelfUrl && currentSelfUrl !== request.selfUrl) {\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#getCurrentSelfUrl --> resolved updated selfUrl, using ${currentSelfUrl}`\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlUpdatedBeforeMediaRequest',\n });\n\n return currentSelfUrl;\n }\n\n return request.selfUrl;\n }\n\n /**\n * Decides whether a 409 warrants a retry against the meeting's latest\n * selfUrl.\n */\n private async shouldRetryOnSelfUrlChange(\n request: Request,\n selfUrlRetryCount: number\n ): Promise<boolean> {\n if (selfUrlRetryCount >= MAX_SELF_URL_RETRY_COUNT) {\n return false;\n }\n\n const roapMessageType =\n request.type === 'RoapMessage' ? request.roapMessage?.messageType : undefined;\n\n const currentSelfUrl = this.getCurrentSelfUrl(request);\n\n if (!currentSelfUrl || currentSelfUrl === request.selfUrl) {\n await this.config.waitForSelfUrlChange();\n\n const latestSelfUrl = this.getCurrentSelfUrl(request);\n\n if (!latestSelfUrl || latestSelfUrl === request.selfUrl) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlNotChangedAfterWait',\n retryAttempt: selfUrlRetryCount,\n roapMessageType,\n });\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, no new selfUrl even after waiting'\n );\n\n return false;\n }\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlChangedAfterWait',\n retryAttempt: selfUrlRetryCount,\n roapMessageType,\n });\n }\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, retrying ${request.type} with updated selfUrl`\n );\n\n return true;\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAF,sBAAA,CAAAN,OAAA;AAAsD,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UATtD;AAqCA;AAAA,IACMc,mBAAmB;EAKvB;EACA,SAAAA,oBACEC,OAAgB,EAChBC,cAAqB,EACrBC,aAAsF,EACtF;IAAA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,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMnB,cAAc,GAAG,IAAIiJ,aAAK,CAAC,CAAC;MAElC,IAAMC,UAAU,GAAG,IAAIpJ,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACyG,eAAe,CAAC0C,IAAI,CAAC,IAAI,CAChC,CAAC;MAED,IAAI,CAAC3G,UAAU,CAAC0G,UAAU,CAAC;MAE3B,IAAAE,aAAK,EAAC;QAAA,OAAMP,MAAI,CAAChG,wBAAwB,CAAC,CAAC;MAAA,EAAC;MAE5C,OAAO7C,cAAc,CAACoE,OAAO;IAC/B;;IAEA;EAAA;IAAA9D,GAAA;IAAAC,KAAA,EACA,SAAO8I,mBAAmBA,CAAA,EAAG;MAC3B,OAAO,IAAI,CAAC/G,eAAe,KAAK,SAAS;IAC3C;;IAEA;AACF;AACA;EAFE;IAAAhC,GAAA;IAAAC,KAAA,EAGA,SAAO+I,oCAAoCA,CAAA,EAAG;MAC5C,IAAI,CAACrH,MAAM,CAACsH,iBAAiB,GAAG,IAAI;IACtC;EAAC;AAAA,EArVoCC,sBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_lodash","require","_common","_events","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_metrics","_constants2","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","result","forEach","d","resolve","catch","reject","MAX_SELF_URL_RETRY_COUNT","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","config","options","_this2","isRequestInProgress","queuedRequests","confluenceState","_inherits2","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","_sendHttpRequest","_asyncToGenerator2","_regenerator","mark","_callee2","_this4","selfUrlRetryCount","uri","_this$getLatestMuteSt","body","localMedias","upload","download","promise","setupProgressListener","_args2","arguments","_t2","wrap","_context2","prev","next","selfUrl","getCurrentSelfUrl","concat","MEDIA","device","correlationId","respOnlySdp","usingResource","abrupt","reachability","clientMediaPreferences","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","EventEmitter","method","HTTP_VERBS","PUT","_ref","_callee","_t","_context","statusCode","shouldRetryOnSelfUrlChange","sent","sendHttpRequest","webex","internal","newMetrics","submitClientEvent","name","meetingId","rawError","stop","_x2","direction","eventEmitter","on","progressEvent","timeStamp","loaded","total","_x","currentSelfUrl","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","LOCUS_MEDIA_REQUEST_RETRY","correlation_id","reason","_shouldRetryOnSelfUrlChange","_callee3","_request$roapMessage","roapMessageType","latestSelfUrl","_context3","waitForSelfUrlChange","retryAttempt","_x3","_x4","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {EventEmitter} from 'events';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request, selfUrlRetryCount: number) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request, 0)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n getCurrentSelfUrl: () => string | undefined;\n waitForSelfUrlChange: () => Promise<void>;\n};\n\nconst MAX_SELF_URL_RETRY_COUNT = 2;\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private async sendHttpRequest(request: Request, selfUrlRetryCount = 0) {\n // Resolve selfUrl lazily at send time. Locus rotates it on session\n // transitions (breakout end, move-to, lobby admit) and the value\n // captured upstream in roap/index.ts may be stale by the time we\n // leave the queue. Persist the resolved URL on the request so a\n // retry can detect a further rotation.\n request.selfUrl = this.getCurrentSelfUrl(request);\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n const upload = new EventEmitter();\n const download = new EventEmitter();\n\n const options = {\n method: HTTP_VERBS.PUT,\n uri,\n body,\n upload,\n download,\n };\n\n // @ts-ignore\n const promise = this.request(options)\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n return result;\n })\n .catch(async (e) => {\n if (\n (e?.statusCode === 409 || e?.statusCode === 403) &&\n (await this.shouldRetryOnSelfUrlChange(request, selfUrlRetryCount))\n ) {\n // In-flight race: selfUrl rotated after we left the queue but\n // before Locus rejected the request. Re-send; getCurrentSelfUrl\n // will pick up the new URL. The returned promise replaces the\n // rejection, so the caller's pendingPromise resolves correctly.\n // Advance the retry count here so the guard in\n // shouldRetryOnSelfUrlChange eventually stops after\n // MAX_SELF_URL_RETRY_COUNT attempts.\n return this.sendHttpRequest(request, selfUrlRetryCount + 1);\n }\n\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n\n if (request.type === 'RoapMessage') {\n const setupProgressListener = (direction: string, eventEmitter: EventEmitter) => {\n eventEmitter.on('progress', (progressEvent: ProgressEvent) => {\n LoggerProxy.logger.info(\n `${request.type}: ${direction} Progress, Timestamp: ${progressEvent.timeStamp}, Progress: ${progressEvent.loaded}/${progressEvent.total}`\n );\n });\n };\n\n setupProgressListener('Upload', options.upload);\n setupProgressListener('Download', options.download);\n }\n\n return promise;\n }\n\n /**\n * Returns the latest selfUrl for this meeting, falling back to the value\n * captured when the request was enqueued.\n */\n private getCurrentSelfUrl(request: Request): string {\n const currentSelfUrl = this.config.getCurrentSelfUrl();\n\n if (currentSelfUrl && currentSelfUrl !== request.selfUrl) {\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#getCurrentSelfUrl --> resolved updated selfUrl, using ${currentSelfUrl}`\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlUpdatedBeforeMediaRequest',\n });\n\n return currentSelfUrl;\n }\n\n return request.selfUrl;\n }\n\n /**\n * Decides whether a 409 warrants a retry against the meeting's latest\n * selfUrl.\n */\n private async shouldRetryOnSelfUrlChange(\n request: Request,\n selfUrlRetryCount: number\n ): Promise<boolean> {\n if (selfUrlRetryCount >= MAX_SELF_URL_RETRY_COUNT) {\n return false;\n }\n\n const roapMessageType =\n request.type === 'RoapMessage' ? request.roapMessage?.messageType : undefined;\n\n const currentSelfUrl = this.getCurrentSelfUrl(request);\n\n if (!currentSelfUrl || currentSelfUrl === request.selfUrl) {\n await this.config.waitForSelfUrlChange();\n\n const latestSelfUrl = this.getCurrentSelfUrl(request);\n\n if (!latestSelfUrl || latestSelfUrl === request.selfUrl) {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlNotChangedAfterWait',\n retryAttempt: selfUrlRetryCount,\n roapMessageType,\n });\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, no new selfUrl even after waiting'\n );\n\n return false;\n }\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY, {\n correlation_id: this.config.correlationId,\n reason: 'selfUrlChangedAfterWait',\n retryAttempt: selfUrlRetryCount,\n roapMessageType,\n });\n }\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> 409 conflict, retrying ${request.type} with updated selfUrl`\n );\n\n return true;\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,WAAA,GAAAF,sBAAA,CAAAN,OAAA;AAAsD,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UATtD;AAqCA;AAAA,IACMc,mBAAmB;EAKvB;EACA,SAAAA,oBACE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UACA;UACA;UACA;UACAsD,oBAAW,CAACC,MAAM,CAACpD,IAAI,CACrB,6FACF,CAAC;UAED,OAAOuG,QAAA,CAAA5J,OAAA,CAAQ+B,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMnB,cAAc,GAAG,IAAIiJ,aAAK,CAAC,CAAC;MAElC,IAAMC,UAAU,GAAG,IAAIpJ,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACyG,eAAe,CAAC0C,IAAI,CAAC,IAAI,CAChC,CAAC;MAED,IAAI,CAAC3G,UAAU,CAAC0G,UAAU,CAAC;MAE3B,IAAAE,aAAK,EAAC;QAAA,OAAMP,MAAI,CAAChG,wBAAwB,CAAC,CAAC;MAAA,EAAC;MAE5C,OAAO7C,cAAc,CAACoE,OAAO;IAC/B;;IAEA;EAAA;IAAA9D,GAAA;IAAAC,KAAA,EACA,SAAO8I,mBAAmBA,CAAA,EAAG;MAC3B,OAAO,IAAI,CAAC/G,eAAe,KAAK,SAAS;IAC3C;;IAEA;AACF;AACA;EAFE;IAAAhC,GAAA;IAAAC,KAAA,EAGA,SAAO+I,oCAAoCA,CAAA,EAAG;MAC5C,IAAI,CAACrH,MAAM,CAACsH,iBAAiB,GAAG,IAAI;IACtC;EAAC;AAAA,EArVoCC,sBAAW","ignoreList":[]}
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -41,10 +41,9 @@
|
|
|
41
41
|
"@types/jsdom": "^21",
|
|
42
42
|
"@webex/babel-config-legacy": "0.0.0",
|
|
43
43
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
44
|
-
"@webex/event-dictionary-ts": "^1.0.2181",
|
|
45
44
|
"@webex/jest-config-legacy": "0.0.0",
|
|
46
45
|
"@webex/legacy-tools": "0.0.0",
|
|
47
|
-
"@webex/plugin-rooms": "3.12.0-next.
|
|
46
|
+
"@webex/plugin-rooms": "3.12.0-next.32",
|
|
48
47
|
"@webex/test-helper-chai": "3.12.0-next.5",
|
|
49
48
|
"@webex/test-helper-mocha": "3.12.0-next.5",
|
|
50
49
|
"@webex/test-helper-mock-webex": "3.12.0-next.5",
|
|
@@ -62,21 +61,22 @@
|
|
|
62
61
|
},
|
|
63
62
|
"dependencies": {
|
|
64
63
|
"@webex/common": "3.12.0-next.5",
|
|
64
|
+
"@webex/event-dictionary-ts": "^1.0.2191",
|
|
65
65
|
"@webex/internal-media-core": "2.26.2",
|
|
66
|
-
"@webex/internal-plugin-conversation": "3.12.0-next.
|
|
67
|
-
"@webex/internal-plugin-device": "3.12.0-next.
|
|
68
|
-
"@webex/internal-plugin-llm": "3.12.0-next.
|
|
69
|
-
"@webex/internal-plugin-mercury": "3.12.0-next.
|
|
70
|
-
"@webex/internal-plugin-metrics": "3.12.0-next.
|
|
71
|
-
"@webex/internal-plugin-support": "3.12.0-next.
|
|
72
|
-
"@webex/internal-plugin-user": "3.12.0-next.
|
|
73
|
-
"@webex/internal-plugin-voicea": "3.12.0-next.
|
|
66
|
+
"@webex/internal-plugin-conversation": "3.12.0-next.32",
|
|
67
|
+
"@webex/internal-plugin-device": "3.12.0-next.30",
|
|
68
|
+
"@webex/internal-plugin-llm": "3.12.0-next.34",
|
|
69
|
+
"@webex/internal-plugin-mercury": "3.12.0-next.31",
|
|
70
|
+
"@webex/internal-plugin-metrics": "3.12.0-next.30",
|
|
71
|
+
"@webex/internal-plugin-support": "3.12.0-next.32",
|
|
72
|
+
"@webex/internal-plugin-user": "3.12.0-next.31",
|
|
73
|
+
"@webex/internal-plugin-voicea": "3.12.0-next.34",
|
|
74
74
|
"@webex/media-helpers": "3.12.0-next.10",
|
|
75
|
-
"@webex/plugin-people": "3.12.0-next.
|
|
76
|
-
"@webex/plugin-rooms": "3.12.0-next.
|
|
75
|
+
"@webex/plugin-people": "3.12.0-next.31",
|
|
76
|
+
"@webex/plugin-rooms": "3.12.0-next.32",
|
|
77
77
|
"@webex/ts-sdp": "^1.8.1",
|
|
78
78
|
"@webex/web-capabilities": "^1.10.0",
|
|
79
|
-
"@webex/webex-core": "3.12.0-next.
|
|
79
|
+
"@webex/webex-core": "3.12.0-next.30",
|
|
80
80
|
"ampersand-collection": "^2.0.2",
|
|
81
81
|
"bowser": "^2.11.0",
|
|
82
82
|
"btoa": "^1.2.1",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"//": [
|
|
95
95
|
"TODO: upgrade jwt-decode when moving to node 18"
|
|
96
96
|
],
|
|
97
|
-
"version": "3.12.0-next.
|
|
97
|
+
"version": "3.12.0-next.97"
|
|
98
98
|
}
|
|
@@ -277,7 +277,7 @@ export class LocusMediaRequest extends WebexPlugin {
|
|
|
277
277
|
})
|
|
278
278
|
.catch(async (e) => {
|
|
279
279
|
if (
|
|
280
|
-
e?.statusCode === 409 &&
|
|
280
|
+
(e?.statusCode === 409 || e?.statusCode === 403) &&
|
|
281
281
|
(await this.shouldRetryOnSelfUrlChange(request, selfUrlRetryCount))
|
|
282
282
|
) {
|
|
283
283
|
// In-flight race: selfUrl rotated after we left the queue but
|
|
@@ -292,13 +292,117 @@ describe('LocusMediaRequest.send()', () => {
|
|
|
292
292
|
assert.calledTwice(webexRequestStub);
|
|
293
293
|
assert.equal(webexRequestStub.getCall(0).args[0].uri, 'oldSelfUrl/media');
|
|
294
294
|
assert.equal(webexRequestStub.getCall(1).args[0].uri, 'newSelfUrl/media');
|
|
295
|
-
assert.
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
assert.calledTwice(sendBehavioralMetricStub);
|
|
296
|
+
assert.calledWithExactly(
|
|
297
|
+
sendBehavioralMetricStub.getCall(0),
|
|
298
|
+
BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY,
|
|
299
|
+
{
|
|
300
|
+
correlation_id: 'correlationId',
|
|
301
|
+
reason: 'selfUrlUpdatedBeforeMediaRequest',
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
assert.calledWithExactly(
|
|
305
|
+
sendBehavioralMetricStub.getCall(1),
|
|
306
|
+
BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY,
|
|
307
|
+
{
|
|
308
|
+
correlation_id: 'correlationId',
|
|
309
|
+
reason: 'selfUrlUpdatedBeforeMediaRequest',
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
it('retries a roap message with the latest resolved selfUrl after a forbidden error', async () => {
|
|
315
|
+
let currentSelfUrl = 'oldSelfUrl';
|
|
316
|
+
const forbiddenError = {statusCode: 403, message: 'forbidden'};
|
|
317
|
+
|
|
318
|
+
locusMediaRequest = new LocusMediaRequest(
|
|
319
|
+
{
|
|
320
|
+
device: {
|
|
321
|
+
url: 'deviceUrl',
|
|
322
|
+
deviceType: 'deviceType',
|
|
323
|
+
regionCode: 'regionCode',
|
|
324
|
+
},
|
|
325
|
+
correlationId: 'correlationId',
|
|
326
|
+
meetingId: 'meetingId',
|
|
327
|
+
preferTranscoding: true,
|
|
328
|
+
getCurrentSelfUrl: () => currentSelfUrl,
|
|
329
|
+
waitForSelfUrlChange,
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
parent: mockWebex,
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
webexRequestStub = sinon.stub(locusMediaRequest, 'request');
|
|
336
|
+
webexRequestStub.onFirstCall().callsFake(() => {
|
|
337
|
+
currentSelfUrl = 'newSelfUrl';
|
|
338
|
+
|
|
339
|
+
return Promise.reject(forbiddenError);
|
|
298
340
|
});
|
|
299
|
-
|
|
300
|
-
|
|
341
|
+
webexRequestStub.onSecondCall().resolves(fakeLocusResponse);
|
|
342
|
+
|
|
343
|
+
const request = cloneDeep(exampleRoapRequestBody);
|
|
344
|
+
|
|
345
|
+
request.selfUrl = 'oldSelfUrl';
|
|
346
|
+
request.roapMessage.messageType = 'ANSWER';
|
|
347
|
+
|
|
348
|
+
const result = await locusMediaRequest.send(request);
|
|
349
|
+
|
|
350
|
+
assert.equal(result, fakeLocusResponse);
|
|
351
|
+
assert.calledTwice(webexRequestStub);
|
|
352
|
+
assert.equal(webexRequestStub.getCall(0).args[0].uri, 'oldSelfUrl/media');
|
|
353
|
+
assert.equal(webexRequestStub.getCall(1).args[0].uri, 'newSelfUrl/media');
|
|
301
354
|
assert.calledTwice(sendBehavioralMetricStub);
|
|
355
|
+
assert.calledWithExactly(
|
|
356
|
+
sendBehavioralMetricStub.getCall(0),
|
|
357
|
+
BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY,
|
|
358
|
+
{
|
|
359
|
+
correlation_id: 'correlationId',
|
|
360
|
+
reason: 'selfUrlUpdatedBeforeMediaRequest',
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
assert.calledWithExactly(
|
|
364
|
+
sendBehavioralMetricStub.getCall(1),
|
|
365
|
+
BEHAVIORAL_METRICS.LOCUS_MEDIA_REQUEST_RETRY,
|
|
366
|
+
{
|
|
367
|
+
correlation_id: 'correlationId',
|
|
368
|
+
reason: 'selfUrlUpdatedBeforeMediaRequest',
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it('does not retry when error is neither 409 nor 403', async () => {
|
|
374
|
+
locusMediaRequest = new LocusMediaRequest(
|
|
375
|
+
{
|
|
376
|
+
device: {
|
|
377
|
+
url: 'deviceUrl',
|
|
378
|
+
deviceType: 'deviceType',
|
|
379
|
+
regionCode: 'regionCode',
|
|
380
|
+
},
|
|
381
|
+
correlationId: 'correlationId',
|
|
382
|
+
meetingId: 'meetingId',
|
|
383
|
+
preferTranscoding: true,
|
|
384
|
+
getCurrentSelfUrl: () => 'sameSelfUrl',
|
|
385
|
+
waitForSelfUrlChange,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
parent: mockWebex,
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
webexRequestStub = sinon.stub(locusMediaRequest, 'request').rejects({
|
|
392
|
+
statusCode: 500,
|
|
393
|
+
message: 'server error',
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
const request = cloneDeep(exampleRoapRequestBody);
|
|
397
|
+
|
|
398
|
+
request.selfUrl = 'sameSelfUrl';
|
|
399
|
+
request.roapMessage.messageType = 'ANSWER';
|
|
400
|
+
|
|
401
|
+
await assert.isRejected(locusMediaRequest.send(request));
|
|
402
|
+
|
|
403
|
+
assert.calledOnce(webexRequestStub);
|
|
404
|
+
assert.equal(webexRequestStub.getCall(0).args[0].uri, 'sameSelfUrl/media');
|
|
405
|
+
assert.notCalled(sendBehavioralMetricStub);
|
|
302
406
|
});
|
|
303
407
|
|
|
304
408
|
it('does not retry a roap conflict when the resolved selfUrl has not changed', async () => {
|