Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

modify type definition of notifications/read according to the implementation #59

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

yuchiki
Copy link

@yuchiki yuchiki commented Mar 15, 2023

fix #60

What

The titile says:

Why

notifications/read's parameter was changed from an ID to a list of IDs.

https://github.com/misskey-dev/misskey/blob/42833cd9219cb8f5abd1756aa1c57b024b125710/packages/backend/src/core/NotificationService.ts#L27

But the type definition does not follow the change.
This type is used in packages/sw/, but this package is not typechecked in CI now
https://github.com/misskey-dev/misskey/blob/develop/packages/sw/src/scripts/notification-read.ts#L42

Additional info (optional)

N/A

@@ -515,7 +515,7 @@ export type Endpoints = {
// notifications
'notifications/create': { req: { body: string; header?: string | null; icon?: string | null; }; res: null; };
'notifications/mark-all-as-read': { req: NoParams; res: null; };
'notifications/read': { req: { notificationId: Notification['id']; }; res: null; };
'notifications/read': { req: { notificationIds: Notification['id'][]; }; res: null; };
Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/misskey-dev/misskey/blob/42833cd9219cb8f5abd1756aa1c57b024b125710/packages/backend/src/server/api/endpoints/notifications/read.ts#L23-L44

実際には両方許可していますね

misskey-dev/misskey#10409 がマージされたらあとでそっちで修正した方が良さそうです

Copy link
Author

@yuchiki yuchiki Mar 29, 2023

Choose a reason for hiding this comment

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

理解しました。

そちらがmergeされたらhttps://github.com/misskey-dev/misskey/pull/10331 の中で修正します!

@yuchiki
Copy link
Author

yuchiki commented Mar 29, 2023

misskey-dev/misskey#10331 の中で、 node_modules/misskey-js/built/api.types.d.ts を直接↑の内容に書き換えた状態で , sw ディレクトリの中で npm run lint が走ることを確かめました!

@syuilo @saschanaz

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notifications/readの型があっていない
2 participants