Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [Unreleased](https://github.com/purecloudlabs/genesys-cloud-streaming-client/compare/v19.4.0...HEAD)
### Fixed
* [STREAM-978](https://inindca.atlassian.net/browse/STREAM-978) - Fix an issue where a StanzaMediaSession would not be cleaned up when ICE connection failed.

### Changed
* [STREAM-941](https://inindca.atlassian.net/browse/STREAM-941) - Fix an issue where notifications.subscribe() with `enablePartialBulkResubscribe` would not resolve/reject based on API result when the requested topic was internally combined with others, e.g. "topic.a" and "topic.b" individually subscribed and bulk resubscribe combines them as "topic?a&b"
* [STREAM-950](https://inindca.atlassian.net/browse/STREAM-950) - Update genesys-cloud-client-logger to pick up change moving from `unload` to `visibilitychange`.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/types/stanza-media-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export class StanzaMediaSession extends MediaSession implements IMediaSession {
candidatesDiscovered: this.iceCandidatesDiscovered,
candidatesReceivedFromPeer: this.iceCandidatesReceivedFromPeer
});
// Cleanup the session because failed is a state of finality.
this.end('failed-transport');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have to do this, because stanza already takes care of that in ICESession and we ultimately extend that.

}

super.onIceStateChange();
Expand Down
8 changes: 5 additions & 3 deletions test/unit/stanza-media-session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('StanzaMediaSession', () => {
expect(spy).not.toHaveBeenCalled();
});

it('should log ICE connection failed along with the number of candidates exchanged', () => {
it('should log ICE connection failed along with the number of candidates exchanged and cleanup.', () => {
const parent = new FakeParent();
const session = new StanzaMediaSession({
options: { parent } as any,
Expand All @@ -183,15 +183,17 @@ describe('StanzaMediaSession', () => {

session['iceCandidatesDiscovered'] = 3;
session['iceCandidatesReceivedFromPeer'] = 5;
const spy = session['_log'] = jest.fn();
const logSpy = session['_log'] = jest.fn();
const endSpy = jest.spyOn(session, 'end');
session['pc'] = { iceConnectionState: 'failed' } as any;

session.onIceStateChange();

expect(spy).toHaveBeenCalledWith('info', 'ICE connection failed', expect.objectContaining({
expect(logSpy).toHaveBeenCalledWith('info', 'ICE connection failed', expect.objectContaining({
candidatesDiscovered: 3,
candidatesReceivedFromPeer: 5
}));
expect(endSpy).toHaveBeenCalledWith('failed-transport');
});

it('should set interruption start', () => {
Expand Down