Skip to content

Commit

Permalink
Merge branch 'hotfix/2020.4.1' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Ito committed Nov 18, 2020
2 parents 8754e2f + bb6e8f3 commit 07dc1b8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
- FIX
- バグ修正

## 2020.4.1

- [FIX] timeout option を設定時に特定の条件で正しく動かない問題を修正する
- peerconnection connectionState が undefined の場合に timeout error が強制的に発動してしまう
- peerconnection 接続前に timeout の時間に到達した場合 timeout error が発動しない
- @yuitowest

## 2020.4.0

- [CHANGE] signaling 時に処理に失敗した場合の reject の引数を CloseEvent オブジェクトから Error オブジェクトに変更する
Expand Down
9 changes: 5 additions & 4 deletions dist/sora.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* sora-js-sdk
* WebRTC SFU Sora JavaScript SDK
* @version: 2020.4.0
* @version: 2020.4.1
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
Expand Down Expand Up @@ -101,7 +101,7 @@
type: "connect",
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/camelcase
sora_client: `Sora JavaScript SDK ${'2020.4.0'}`,
sora_client: `Sora JavaScript SDK ${'2020.4.1'}`,
environment: window.navigator.userAgent,
role: role,
// eslint-disable-next-line @typescript-eslint/camelcase
Expand Down Expand Up @@ -610,7 +610,8 @@
return new Promise((_, reject) => {
if (this.options.timeout && 0 < this.options.timeout) {
setTimeout(() => {
if (this.pc && this.pc.connectionState !== "connected") {
if (!this.pc ||
(this.pc && this.pc.connectionState !== undefined && this.pc.connectionState !== "connected")) {
const error = new Error();
error.message = "CONNECTION TIMEOUT";
this.callbacks.timeout();
Expand Down Expand Up @@ -883,7 +884,7 @@
},
version: function () {
// @ts-ignore
return '2020.4.0';
return '2020.4.1';
},
};

Expand Down
4 changes: 2 additions & 2 deletions dist/sora.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions dist/sora.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* sora-js-sdk
* WebRTC SFU Sora JavaScript SDK
* @version: 2020.4.0
* @version: 2020.4.1
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
Expand Down Expand Up @@ -95,7 +95,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options) {
type: "connect",
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/camelcase
sora_client: `Sora JavaScript SDK ${'2020.4.0'}`,
sora_client: `Sora JavaScript SDK ${'2020.4.1'}`,
environment: window.navigator.userAgent,
role: role,
// eslint-disable-next-line @typescript-eslint/camelcase
Expand Down Expand Up @@ -604,7 +604,8 @@ class ConnectionBase {
return new Promise((_, reject) => {
if (this.options.timeout && 0 < this.options.timeout) {
setTimeout(() => {
if (this.pc && this.pc.connectionState !== "connected") {
if (!this.pc ||
(this.pc && this.pc.connectionState !== undefined && this.pc.connectionState !== "connected")) {
const error = new Error();
error.message = "CONNECTION TIMEOUT";
this.callbacks.timeout();
Expand Down Expand Up @@ -877,7 +878,7 @@ var sora = {
},
version: function () {
// @ts-ignore
return '2020.4.0';
return '2020.4.1';
},
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sora-js-sdk",
"version": "2020.4.0",
"version": "2020.4.1",
"description": "WebRTC SFU Sora JavaScript SDK",
"main": "dist/sora.min.js",
"module": "dist/sora.mjs",
Expand Down
5 changes: 4 additions & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ export default class ConnectionBase {
return new Promise((_, reject) => {
if (this.options.timeout && 0 < this.options.timeout) {
setTimeout(() => {
if (this.pc && this.pc.connectionState !== "connected") {
if (
!this.pc ||
(this.pc && this.pc.connectionState !== undefined && this.pc.connectionState !== "connected")
) {
const error = new Error();
error.message = "CONNECTION TIMEOUT";
this.callbacks.timeout();
Expand Down

0 comments on commit 07dc1b8

Please sign in to comment.