Skip to content

Commit

Permalink
v1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shisoAqron committed May 21, 2024
1 parent 7ec62c7 commit c081cfb
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 94 deletions.
8 changes: 4 additions & 4 deletions THIRD_PARTY_LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SOFTWARE.

---

@skyway-sdk/[email protected].0
@skyway-sdk/[email protected].1

MIT

Expand Down Expand Up @@ -122,7 +122,7 @@ SOFTWARE.

---

@skyway-sdk/[email protected].0
@skyway-sdk/[email protected].1

MIT

Expand Down Expand Up @@ -246,7 +246,7 @@ SOFTWARE.

---

@skyway-sdk/[email protected].0
@skyway-sdk/[email protected].1

MIT

Expand Down Expand Up @@ -457,7 +457,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---

axios@1.6.8
axios@1.7.1

MIT

Expand Down
66 changes: 21 additions & 45 deletions 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 packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skyway-sdk/core",
"version": "1.8.0",
"version": "1.8.1",
"description": "The official Next Generation JavaScript SDK for SkyWay",
"homepage": "https://skyway.ntt.com/",
"repository": {
Expand Down
87 changes: 51 additions & 36 deletions packages/core/src/plugin/internal/person/connection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ export class P2PConnection implements SkyWayConnection {
localPersonId: this.localPerson.id,
});
private _pubsubQueue = new PromiseQueue();
private sendSubscriptionStatsReportTimer: ReturnType<
typeof setInterval
> | null = null;
private sendSubscriptionStatsReportTimers: Map<
string,
ReturnType<typeof setInterval>
> = new Map();
private _waitingSendSubscriptionStatsReportsFromPublish: Map<string, string> =
new Map();
private _waitingSendSubscriptionStatsReportsFromSubscribe: string[] = [];
Expand Down Expand Up @@ -155,8 +156,12 @@ export class P2PConnection implements SkyWayConnection {
this._log.debug('<stopPublishing> end', { publication });
});

if (this.sendSubscriptionStatsReportTimer) {
clearInterval(this.sendSubscriptionStatsReportTimer);
// publication(=stream)のidをkeyとして一致するタイマーを取得する
const sendSubscriptionStatsReportTimer =
this.sendSubscriptionStatsReportTimers.get(publication.id);
if (sendSubscriptionStatsReportTimer) {
clearInterval(sendSubscriptionStatsReportTimer);
this.sendSubscriptionStatsReportTimers.delete(publication.id);
}
}

Expand Down Expand Up @@ -221,8 +226,12 @@ export class P2PConnection implements SkyWayConnection {
this._closeIfNeeded();
});

if (this.sendSubscriptionStatsReportTimer) {
clearInterval(this.sendSubscriptionStatsReportTimer);
// subscription(=stream)のidをkeyとして一致するタイマーを取得する
const sendSubscriptionStatsReportTimer =
this.sendSubscriptionStatsReportTimers.get(subscription.id);
if (sendSubscriptionStatsReportTimer) {
clearInterval(sendSubscriptionStatsReportTimer);
this.sendSubscriptionStatsReportTimers.delete(subscription.id);
}
}

Expand Down Expand Up @@ -286,38 +295,44 @@ export class P2PConnection implements SkyWayConnection {
if (this._analytics) {
const role = stream instanceof PublicationImpl ? 'sender' : 'receiver';
const intervalSec = this._analytics.client.getIntervalSec();
this.sendSubscriptionStatsReportTimer = setInterval(async () => {
if (!this._analytics) {
throw createError({
operationName: 'P2PConnection.sendSubscriptionStatsReportTimer',
info: {
...errors.missingProperty,
detail: 'AnalyticsSession not exist',
},
path: log.prefix,
context: this._context,
channel: this.localPerson.channel,
});
}
this.sendSubscriptionStatsReportTimers.set(
stream.id,
setInterval(async () => {
if (!this._analytics) {
throw createError({
operationName: 'P2PConnection.sendSubscriptionStatsReportTimer',
info: {
...errors.missingProperty,
detail: 'AnalyticsSession not exist',
},
path: log.prefix,
context: this._context,
channel: this.localPerson.channel,
});
}

// AnalyticsSessionがcloseされていたらタイマーを止める
if (this._analytics.isClosed()) {
if (this.sendSubscriptionStatsReportTimer) {
clearInterval(this.sendSubscriptionStatsReportTimer);
// AnalyticsSessionがcloseされていたらタイマーを止める
if (this._analytics.isClosed()) {
const subscriptionStatsReportTimer =
this.sendSubscriptionStatsReportTimers.get(stream.id);
if (subscriptionStatsReportTimer) {
clearInterval(subscriptionStatsReportTimer);
this.sendSubscriptionStatsReportTimers.delete(stream.id);
}
return;
}
return;
}

const stats = await this.getStats(stream);
if (stats) {
// 再送時に他の処理をブロックしないためにawaitしない
void this._analytics.client.sendSubscriptionStatsReport(stats, {
subscriptionId: subscriptionId,
role: role,
createdAt: Date.now(),
});
}
}, intervalSec * 1000);
const stats = await this.getStats(stream);
if (stats) {
// 再送時に他の処理をブロックしないためにawaitしない
void this._analytics.client.sendSubscriptionStatsReport(stats, {
subscriptionId: subscriptionId,
role: role,
createdAt: Date.now(),
});
}
}, intervalSec * 1000)
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const PACKAGE_VERSION = '1.8.0';
export const PACKAGE_VERSION = '1.8.1';
6 changes: 3 additions & 3 deletions packages/room/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skyway-sdk/room",
"version": "1.8.0",
"version": "1.8.1",
"description": "The official Next Generation JavaScript SDK for SkyWay",
"homepage": "https://skyway.ntt.com/",
"repository": {
Expand Down Expand Up @@ -46,8 +46,8 @@
"watch:tsc": "tsc -p tsconfig.build.json -w"
},
"dependencies": {
"@skyway-sdk/core": "^1.8.0",
"@skyway-sdk/sfu-bot": "^1.8.0",
"@skyway-sdk/core": "^1.8.1",
"@skyway-sdk/sfu-bot": "^1.8.1",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/room/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const PACKAGE_VERSION = '1.8.0';
export const PACKAGE_VERSION = '1.8.1';
4 changes: 2 additions & 2 deletions packages/sfu-bot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skyway-sdk/sfu-bot",
"version": "1.8.0",
"version": "1.8.1",
"description": "The official Next Generation JavaScript SDK for SkyWay",
"homepage": "https://skyway.ntt.com/",
"repository": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"watch:tsc": "tsc -p tsconfig.build.json -w"
},
"dependencies": {
"@skyway-sdk/core": "^1.8.0",
"@skyway-sdk/core": "^1.8.1",
"@skyway-sdk/sfu-api-client": "^1.4.6",
"lodash": "4.17.21",
"mediasoup-client": "3.6.82"
Expand Down
2 changes: 1 addition & 1 deletion packages/sfu-bot/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const PACKAGE_VERSION = '1.8.0';
export const PACKAGE_VERSION = '1.8.1';

0 comments on commit c081cfb

Please sign in to comment.