genesys-cloud-streaming-client 17.0.2 → 17.0.3-develop.90

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.
@@ -55,6 +55,7 @@ export declare class Client extends EventEmitter {
55
55
  connect(connectOpts?: StreamingClientConnectOptions): Promise<void>;
56
56
  private backoffConnectRetryHandler;
57
57
  private makeConnectionAttempt;
58
+ private setupPinger;
58
59
  private prepareForConnect;
59
60
  stopServerLogging(): void;
60
61
  startServerLogging(): void;
@@ -428,7 +428,7 @@ class Client extends events_1.default {
428
428
  extension.handleStanzaInstanceChange(stanzaInstance);
429
429
  }
430
430
  this.activeStanzaInstance = stanzaInstance;
431
- stanzaInstance.pinger = new ping_1.Ping(this, stanzaInstance);
431
+ await this.setupPinger(stanzaInstance);
432
432
  this.emit('connected');
433
433
  }
434
434
  catch (err) {
@@ -443,6 +443,16 @@ class Client extends events_1.default {
443
443
  throw err;
444
444
  }
445
445
  }
446
+ async setupPinger(stanzaInstance) {
447
+ try {
448
+ // if this fails, then hawk doesn't support serverside pinging and we need to do client side pings
449
+ await stanzaInstance.subscribeToNode(this._notifications.pubsubHost, 'enable.server.side.pings');
450
+ }
451
+ catch (err) {
452
+ this.logger.warn('failed to establish server-side pinging, falling back to client-side pinging', { stanzaInstanceId: stanzaInstance.id, channelId: stanzaInstance.channelId });
453
+ stanzaInstance.pinger = new ping_1.Ping(this, stanzaInstance);
454
+ }
455
+ }
446
456
  async prepareForConnect() {
447
457
  if (this.config.jwt) {
448
458
  this.hardReconnectRequired = false;
@@ -511,7 +521,7 @@ class Client extends events_1.default {
511
521
  return Client.version;
512
522
  }
513
523
  static get version() {
514
- return '17.0.2';
524
+ return '17.0.3';
515
525
  }
516
526
  }
517
527
  exports.Client = Client;
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "developercenter-cdn/streaming-client",
3
- "version": "17.0.2",
3
+ "version": "17.0.3",
4
4
  "ecosystem": "pc",
5
5
  "team": "Genesys Client Media (WebRTC)",
6
6
  "indexFiles": [
7
7
  {
8
- "file": "v17.0.2/streaming-client.browser.ie.js"
8
+ "file": "v17.0.3/streaming-client.browser.ie.js"
9
9
  },
10
10
  {
11
- "file": "v17.0.2/streaming-client.browser.js"
11
+ "file": "v17.0.3/streaming-client.browser.js"
12
12
  },
13
13
  {
14
14
  "file": "v17/streaming-client.browser.ie.js"
@@ -17,6 +17,6 @@
17
17
  "file": "v17/streaming-client.browser.js"
18
18
  }
19
19
  ],
20
- "build": "86",
21
- "buildDate": "2024-02-16T19:28:47.751677Z"
20
+ "build": "90",
21
+ "buildDate": "2024-03-05T18:16:21.636020Z"
22
22
  }
@@ -55,6 +55,7 @@ export declare class Client extends EventEmitter {
55
55
  connect(connectOpts?: StreamingClientConnectOptions): Promise<void>;
56
56
  private backoffConnectRetryHandler;
57
57
  private makeConnectionAttempt;
58
+ private setupPinger;
58
59
  private prepareForConnect;
59
60
  stopServerLogging(): void;
60
61
  startServerLogging(): void;
package/dist/es/client.js CHANGED
@@ -435,7 +435,7 @@ export class Client extends EventEmitter {
435
435
  extension.handleStanzaInstanceChange(stanzaInstance);
436
436
  }
437
437
  this.activeStanzaInstance = stanzaInstance;
438
- stanzaInstance.pinger = new Ping(this, stanzaInstance);
438
+ yield this.setupPinger(stanzaInstance);
439
439
  this.emit('connected');
440
440
  }
441
441
  catch (err) {
@@ -451,6 +451,18 @@ export class Client extends EventEmitter {
451
451
  }
452
452
  });
453
453
  }
454
+ setupPinger(stanzaInstance) {
455
+ return __awaiter(this, void 0, void 0, function* () {
456
+ try {
457
+ // if this fails, then hawk doesn't support serverside pinging and we need to do client side pings
458
+ yield stanzaInstance.subscribeToNode(this._notifications.pubsubHost, 'enable.server.side.pings');
459
+ }
460
+ catch (err) {
461
+ this.logger.warn('failed to establish server-side pinging, falling back to client-side pinging', { stanzaInstanceId: stanzaInstance.id, channelId: stanzaInstance.channelId });
462
+ stanzaInstance.pinger = new Ping(this, stanzaInstance);
463
+ }
464
+ });
465
+ }
454
466
  prepareForConnect() {
455
467
  return __awaiter(this, void 0, void 0, function* () {
456
468
  if (this.config.jwt) {
@@ -521,6 +533,6 @@ export class Client extends EventEmitter {
521
533
  return Client.version;
522
534
  }
523
535
  static get version() {
524
- return '17.0.2';
536
+ return '17.0.3';
525
537
  }
526
538
  }
@@ -41837,7 +41837,7 @@ class Client extends EventEmitter {
41837
41837
  extension.handleStanzaInstanceChange(stanzaInstance);
41838
41838
  }
41839
41839
  this.activeStanzaInstance = stanzaInstance;
41840
- stanzaInstance.pinger = new Ping(this, stanzaInstance);
41840
+ yield this.setupPinger(stanzaInstance);
41841
41841
  this.emit('connected');
41842
41842
  }
41843
41843
  catch (err) {
@@ -41853,6 +41853,18 @@ class Client extends EventEmitter {
41853
41853
  }
41854
41854
  });
41855
41855
  }
41856
+ setupPinger(stanzaInstance) {
41857
+ return __awaiter$5(this, void 0, void 0, function* () {
41858
+ try {
41859
+ // if this fails, then hawk doesn't support serverside pinging and we need to do client side pings
41860
+ yield stanzaInstance.subscribeToNode(this._notifications.pubsubHost, 'enable.server.side.pings');
41861
+ }
41862
+ catch (err) {
41863
+ this.logger.warn('failed to establish server-side pinging, falling back to client-side pinging', { stanzaInstanceId: stanzaInstance.id, channelId: stanzaInstance.channelId });
41864
+ stanzaInstance.pinger = new Ping(this, stanzaInstance);
41865
+ }
41866
+ });
41867
+ }
41856
41868
  prepareForConnect() {
41857
41869
  return __awaiter$5(this, void 0, void 0, function* () {
41858
41870
  if (this.config.jwt) {
@@ -41923,7 +41935,7 @@ class Client extends EventEmitter {
41923
41935
  return Client.version;
41924
41936
  }
41925
41937
  static get version() {
41926
- return '17.0.2';
41938
+ return '17.0.3';
41927
41939
  }
41928
41940
  }
41929
41941
 
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  # [Unreleased](https://github.com/purecloudlabs/genesys-cloud-streaming-client/compare/v17.0.2...HEAD)
8
+ ### Changed
9
+ * [PCM-2321](https://inindca.atlassian.net/browse/PCM-2321) default to server-side pinging, fallback to client side pinging
10
+
8
11
  # [v17.0.2](https://github.com/purecloudlabs/genesys-cloud-streaming-client/compare/v17.0.1...v17.0.2)
9
12
  ### Changed
10
13
  * [PCM-2312](https://inindca.atlassian.net/browse/PCM-2312) bump logger version
@@ -55,6 +55,7 @@ export declare class Client extends EventEmitter {
55
55
  connect(connectOpts?: StreamingClientConnectOptions): Promise<void>;
56
56
  private backoffConnectRetryHandler;
57
57
  private makeConnectionAttempt;
58
+ private setupPinger;
58
59
  private prepareForConnect;
59
60
  stopServerLogging(): void;
60
61
  startServerLogging(): void;
@@ -428,7 +428,7 @@ class Client extends events_1.default {
428
428
  extension.handleStanzaInstanceChange(stanzaInstance);
429
429
  }
430
430
  this.activeStanzaInstance = stanzaInstance;
431
- stanzaInstance.pinger = new ping_1.Ping(this, stanzaInstance);
431
+ await this.setupPinger(stanzaInstance);
432
432
  this.emit('connected');
433
433
  }
434
434
  catch (err) {
@@ -443,6 +443,16 @@ class Client extends events_1.default {
443
443
  throw err;
444
444
  }
445
445
  }
446
+ async setupPinger(stanzaInstance) {
447
+ try {
448
+ // if this fails, then hawk doesn't support serverside pinging and we need to do client side pings
449
+ await stanzaInstance.subscribeToNode(this._notifications.pubsubHost, 'enable.server.side.pings');
450
+ }
451
+ catch (err) {
452
+ this.logger.warn('failed to establish server-side pinging, falling back to client-side pinging', { stanzaInstanceId: stanzaInstance.id, channelId: stanzaInstance.channelId });
453
+ stanzaInstance.pinger = new ping_1.Ping(this, stanzaInstance);
454
+ }
455
+ }
446
456
  async prepareForConnect() {
447
457
  if (this.config.jwt) {
448
458
  this.hardReconnectRequired = false;
@@ -511,7 +521,7 @@ class Client extends events_1.default {
511
521
  return Client.version;
512
522
  }
513
523
  static get version() {
514
- return '17.0.2';
524
+ return '17.0.3';
515
525
  }
516
526
  }
517
527
  exports.Client = Client;