Skip to content

Commit 00625f6

Browse files
authored
Removing destroy listener to onEnded API (#759)
1 parent 699ef4d commit 00625f6

File tree

8 files changed

+13
-12
lines changed

8 files changed

+13
-12
lines changed

Documentation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,10 +981,13 @@ Subscribe a method to be invoked whenever the contact is missed. This is an even
981981
```js
982982
contact.onEnded(function(contact) { /* ... */ });
983983
```
984-
Subscribe a method to be invoked whenever the contact is ended or destroyed. This could be due to the conversation
984+
Subscribe a method to be invoked whenever the contact is ended. This could be due to the conversation
985985
being ended by the agent, or due to the contact being missed. Call `contact.getState()` to determine the state
986986
of the contact and take appropriate action.
987987

988+
[Update on v2.7.0]`
989+
The callback function registered via `contact.onEnded ` is no longer invoked when the contact is destroyed. This fix prevents the callback from being invoked twice on ENDED and DESTROYED events.
990+
988991
### `contact.onDestroy()`
989992
```js
990993
contact.onDestroy(function(contact) { /* ... */ });

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amazon-connect-streams",
3-
"version": "2.6.4",
3+
"version": "2.7.0",
44
"description": "Amazon Connect Streams Library",
55
"engines": {
66
"node": ">=12.0.0"

release/connect-streams-dr-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/connect-streams-dr.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/connect-streams-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/connect-streams.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,6 @@
944944
Contact.prototype.onEnded = function (f) {
945945
var bus = connect.core.getEventBus();
946946
bus.subscribe(this.getEventName(connect.ContactEvents.ENDED), f);
947-
bus.subscribe(this.getEventName(connect.ContactEvents.DESTROYED), f);
948947
};
949948

950949
Contact.prototype.onDestroy = function (f) {
@@ -26297,7 +26296,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;// AWS SDK for JavaScript v2.1377.0
2629726296

2629826297
connect.core = {};
2629926298
connect.core.initialized = false;
26300-
connect.version = "2.6.2";
26299+
connect.version = "2.7.0";
2630126300
connect.outerContextStreamsVersion = null;
2630226301
connect.DEFAULT_BATCH_SIZE = 500;
2630326302

@@ -27573,7 +27572,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;// AWS SDK for JavaScript v2.1377.0
2757327572
connect.core.ccpLoadTimeoutInstance = null;
2757427573
}
2757527574

27576-
conduit.sendUpstream(connect.EventType.OUTER_CONTEXT_INFO, { streamsVersion: connect.version, initCCPParams: params });
27575+
conduit.sendUpstream(connect.EventType.OUTER_CONTEXT_INFO, { streamsVersion: connect.version });
2757727576

2757827577
connect.core.keepaliveManager.start();
2757927578
this.unsubscribe();

src/api.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,6 @@
751751
Contact.prototype.onEnded = function (f) {
752752
var bus = connect.core.getEventBus();
753753
bus.subscribe(this.getEventName(connect.ContactEvents.ENDED), f);
754-
bus.subscribe(this.getEventName(connect.ContactEvents.DESTROYED), f);
755754
};
756755

757756
Contact.prototype.onDestroy = function (f) {

0 commit comments

Comments
 (0)