Skip to content

Commit

Permalink
Merge pull request #132 from bridie-hifi/06-10-patch-release
Browse files Browse the repository at this point in the history
Merge Patch into release
  • Loading branch information
hd23408 authored Jun 10, 2021
2 parents 5ff60c1 + dda4e01 commit 8670151
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hifi-spatial-audio",
"version": "1.2.0",
"version": "1.2.1",
"description": "The High Fidelity Audio Client Library allows developers to integrate High Fidelity's spatial audio technology into their projects.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions src/classes/HiFiMixerSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,14 @@ export class HiFiMixerSession {
}
this._setCurrentHiFiConnectionState(HiFiConnectionStates.Failed);
break;
case RaviSessionStates.CLOSED:
// We don't want to override an "Unavailable" state. (This will hopefully
// be able to go away once changes from HIFI-629 are complete, but is safe to leave in for now.)
if (this._currentHiFiConnectionState === HiFiConnectionStates.Unavailable) {
break;
}
this._setCurrentHiFiConnectionState(HiFiConnectionStates.Disconnected);
break;
}
}

Expand Down
12 changes: 9 additions & 3 deletions tests/smoke/rest.smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,13 @@ describe('HiFi API REST Calls', () => {
});
await sleep(30000);
for (let i = 0; i < numberTestUsers; i++) {
if (i === 0) expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Failed);
else expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Connected);
if (i === 0) {
expect(testUsers[i].connectionFailed).toBe(true);
expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Disconnected);
} else {
expect(testUsers[i].connectionFailed).toBe(false);
expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Connected);
}
}
});

Expand All @@ -404,7 +409,8 @@ describe('HiFi API REST Calls', () => {
});
await sleep(30000);
for (let i = 0; i < numberTestUsers; i++) {
expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Failed);
expect(testUsers[i].connectionFailed).toBe(true);
expect(testUsers[i].connectionState).toBe(HiFiConnectionStates.Disconnected);
}
});
});
Expand Down
5 changes: 5 additions & 0 deletions tests/testUtilities/TestUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ export type MuteState = "MUTED_FIXED" | "MUTED_NOT_FIXED" | "UNMUTED";
export class TestUser {
name: string;
connectionState: HiFiConnectionStates;
connectionFailed: boolean;
muteState: MuteState;
communicator: HiFiCommunicator;

constructor(name: string) {
this.name = name;
this.connectionFailed = false;
this.connectionState = HiFiConnectionStates.Disconnected;
this.muteState = "UNMUTED";
this.communicator = new HiFiCommunicator({
Expand All @@ -20,6 +22,9 @@ export class TestUser {

onConnectionStateChanged(connectionState: HiFiConnectionStates) {
this.connectionState = connectionState;
if (connectionState === HiFiConnectionStates.Failed) {
this.connectionFailed = true;
}
}

onMuteChanged(data: any) {
Expand Down

0 comments on commit 8670151

Please sign in to comment.