From 1b3ed1c883fb417bc44751b6e9cede2868efad96 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:19:19 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix(misskey-js):=20WebSocket=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E7=BE=A9=E3=82=92ReconnectingWebsocket?= =?UTF-8?q?=E3=81=AB=E4=BE=9D=E5=AD=98=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/misskey-js/src/streaming.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts index ffb46c77f6c1..6e34ec150817 100644 --- a/packages/misskey-js/src/streaming.ts +++ b/packages/misskey-js/src/streaming.ts @@ -51,7 +51,7 @@ export default class Stream extends EventEmitter implements IStrea private idCounter = 0; constructor(origin: string, user: { token: string; } | null, options?: { - WebSocket?: WebSocket; + WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; }) { super(); From 10bf1b8f9722a3ccb6cd171f8e82043d011cd05f Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:21:56 +0900 Subject: [PATCH 2/5] Update Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c35aa3679f19..ef1143e407a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ - Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正 (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706) +## Misskey.js +- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 + ## 2024.10.1 ### Note From 57ebf9465b77b582f016b820cecb1fcbdbdd7a8a Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:22:40 +0900 Subject: [PATCH 3/5] run api extractor --- packages/misskey-js/etc/misskey-js.api.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 72c236373d03..61de8b8c7e5c 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -7,6 +7,7 @@ import type { AuthenticationResponseJSON } from '@simplewebauthn/types'; import { EventEmitter } from 'eventemitter3'; import type { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types'; +import _ReconnectingWebsocket from 'reconnecting-websocket'; // Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts // @@ -3137,7 +3138,7 @@ export class Stream extends EventEmitter implements IStream { constructor(origin: string, user: { token: string; } | null, options?: { - WebSocket?: WebSocket; + WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; }); // (undocumented) close(): void; From 0c06ebba8373022212c041d39f9c0a81edf86daa Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:26:41 +0900 Subject: [PATCH 4/5] fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef1143e407a4..03461956c0d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ - Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正 (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706) -## Misskey.js +### Misskey.js - Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 ## 2024.10.1 From e5dc4e2c26b48b69f49cfb67a81d3b0698d9b509 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:37:41 +0900 Subject: [PATCH 5/5] fix --- packages/backend/test-federation/test/utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/backend/test-federation/test/utils.ts b/packages/backend/test-federation/test/utils.ts index 483bf4b254cc..093277cdb498 100644 --- a/packages/backend/test-federation/test/utils.ts +++ b/packages/backend/test-federation/test/utils.ts @@ -232,7 +232,6 @@ export async function isFired { return new Promise(async (resolve, reject) => { - // @ts-expect-error TODO: why? const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); const connection = stream.useChannel(channel, params); connection.on(type as any, ((msg: any) => { @@ -266,7 +265,6 @@ export async function isNoteUpdatedEventFired( cond: (msg: Parameters[0]) => boolean, ): Promise { return new Promise(async (resolve, reject) => { - // @ts-expect-error TODO: why? const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); stream.send('s', { id: noteId }); stream.on('noteUpdated', msg => {