Commit Graph

223 Commits

Author SHA1 Message Date
tamaina 9542cb8d62
fix(backend): リモートサーバーの情報が更新できなくなっていた問題を修正 (#13507)
* fix(backend): fetchInstanceMetadataのLockが永遠に解除されない問題を修正

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>

* fix test

* fix

* comment

* comment

* improve test

---------

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
2024-03-04 13:48:57 +09:00
zyoshoka 38837bd388
test(backend): refactor tests (#13499)
* test(backend): refactor tests

* fix: failed test
2024-03-03 20:15:35 +09:00
syuilo 5904d98208
Update packages/backend/test/e2e/mute.ts
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
2024-03-01 17:26:27 +09:00
Yuriha 26d4c5fd94
メンションの最大数をロールごとに設定可能にする (#13343)
* Add new role policy: maximum mentions per note

* fix

* Reviewを反映

* fix

* Add ChangeLog

* Update type definitions

* Add E2E test

* CHANGELOG に説明を追加

---------

Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com>
2024-02-29 20:48:02 +09:00
zyoshoka 16f16e6b08
fix(backend): ダイレクトなノートに対してはダイレクトでしか返信できないように (#13477)
* fix(backend): ダイレクトなノートに対してはダイレクトでしか返信できないように

* Update CHANGELOG.md

* test(backend): `notes/create`とWebSocket関連のテストを追加
2024-02-29 20:42:02 +09:00
taichan 5f43c2faa2
enhance(backend): 通知がミュート・凍結を考慮するようにする (#13412)
* Never return broken notifications #409

Since notifications are stored in Redis, we can't expect relational
integrity: deleting a user will *not* delete notifications that
mention it.

But if we return notifications with missing bits (a `follow` without a
`user`, for example), the frontend will get very confused and throw an
exception while trying to render them.

This change makes sure we never expose those broken notifications. For
uniformity, I've applied the same logic to notes and roles mentioned
in notifications, even if nobody reported breakage in those cases.

Tested by creating a few types of notifications with a `notifierId`,
then deleting their user.

(cherry picked from commit 421f8d49e5d7a8dc3a798cc54716c767df8be3cb)

* Update Changelog

* Update CHANGELOG.md

* enhance: 通知がミュートを考慮するようにする

* enhance: 通知が凍結も考慮するようにする

* fix: notifierIdがない通知が消えてしまう問題

* Add tests (通知がミュートを考慮しているかどうか)

* fix: notifierIdがない通知が消えてしまう問題 (grouped)

* Remove unused import

* Fix: typo

* Revert "enhance: 通知が凍結も考慮するようにする"

This reverts commit b1e57e571d.

* Revert API handling

* Remove unused imports

* enhance: Check if notifierId is valid in NotificationEntityService

* 通知作成時にpackしてnullになったらあとの処理をやめる

* Remove duplication of valid notifier check

* add filter notification is not null

* Revert "Remove duplication of valid notifier check"

This reverts commit 239a6952f7.

* Improve performance

* Fix packGrouped

* Refactor: 判定部分を共通化

* Fix condition

* use isNotNull

* Update CHANGELOG.md

* filterの改善

* Refactor: DONT REPEAT YOURSELF
Note: GroupedNotificationはNotificationの拡張なのでその例外だけ書けば基本的に共通の処理になり複雑な個別の処理は増えにくいと思われる

* Add groupedNotificationTypes

* Update misskey-js typedef

* Refactor: less sql calls

* refactor

* clean up

* filter notes to mark as read

* packed noteがmapなのでそちらを使う

* if (notesToRead.size > 0)

* if (notes.length === 0) return;

* fix

* Revert "if (notes.length === 0) return;"

This reverts commit 22e2324f96.

* 🎨

* console.error

* err

* remove try-catch

* 不要なジェネリクスを除去

* Revert  (既読処理をpack内で行うものを元に戻す)

* Clean

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/NotificationService.ts

* Clean

---------

Co-authored-by: dakkar <dakkar@thenautilus.net>
Co-authored-by: kakkokari-gtyih <daisho7308+f@gmail.com>
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2024-02-28 21:26:26 +09:00
zyoshoka 664aeb3ced
fix(backend): リノート時のHTLへのストリーミングの意図しない挙動を修正 (#13425)
* fix(backend): リノート時のストリーミングの意図しない挙動を修正

* Update CHANGELOG.md

* fix: 不要な返り値

* fix: 不適切な条件分岐を修正

* test(backend): add htl tests

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2024-02-28 17:43:17 +09:00
zawa-ch f906ad6ca7
Enhance: コンディショナルロールの条件に「マニュアルロールへのアサイン」を追加 (#13463)
* コンディショナルロールの条件に「マニュアルロールへのアサイン」を追加

* コメント修正
2024-02-27 18:45:46 +09:00
okayurisotto 750d262604
refactor(backend): `ReactionService.prototype.convertLegacyReactions` (#13375)
* add unit tests

* cleanup unnecessary type assertions

* `convertedReaction`変数の定義と変換表に対する存在確認処理の整理

* `count`変数の定義とループ処理での`Object.entries()`の活用

* 条件式の整理

* `Array.prototype.reduce`を使うように

* `Array.prototype.reduce`を使うように

* 配列操作を1つのメソッドチェーンに整理

これまでの実装では、`decodeReaction`の返り値が同一になる異なる入力値が同時に複数個存在した場合、後ろのもので上書きされてしまっていたはず。
これからの実装では、後ろのものは前のものに加算される。
(実際にこの挙動の変更が問題になるシチュエーションはまずないはず。)

* add unit test

* ドキュメントコメントの追加と型定義の調整
2024-02-21 14:31:50 +09:00
tamaina 9a70ce8f5e
Merge pull request from GHSA-qqrm-9grj-6v32
* maybe ok

* fix

* test wip

* ✌️

* fix

* if (res.ok)

* validateContentTypeSetAsJsonLD

* 条件を考慮し直す

* その他の+json接尾辞が付いているメディアタイプも受け容れる

* https://github.com/misskey-dev/misskey-ghsa-qqrm-9grj-6v32/pull/1#discussion_r1490999009

* add `; profile="https://www.w3.org/ns/activitystreams"`

* application/ld+json;
2024-02-17 12:41:19 +09:00
zyoshoka 37959bab1d
refactor(backend): remove/replace deprecated type deps (#13252) 2024-02-16 20:09:07 +09:00
tamaina c1514ce91d (re) update SPDX-FileCopyrightText
Fix  #13290
2024-02-13 15:59:27 +00:00
tamaina 311c2172d7 Revert "update SPDX-FileCopyrightText"
This reverts commit 9b5aeb76d8.
2024-02-13 15:50:11 +00:00
tamaina 32c5c43b6d
enhance: 禁止ワードはリモートノートも対象に (#13280)
Resolve #13279
2024-02-13 04:54:01 +09:00
syuilo 9b5aeb76d8 update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
おさむのひと 614c9a0fc6
fix: 特定文字列を含むノートを投稿できないようにする管理画面用設定項目を追加 (#13210)
* fix: 特定文字列を含むノートを投稿できないようにする管理画面用設定項目を追加

* Serviceでチェックするように変更
2024-02-09 10:07:18 +09:00
MeiMei e89d760240
Enhance: 連合向けのノート配信を軽量化 (#13192)
* AP HTML表現をシンプルに

* a

* CHANGELOG

* リンク
2024-02-07 19:57:59 +09:00
YS d92aaf81c4
refactor: noteテーブルのインデックス整理と配列カラムへのクエリでインデックスを使うように (#12993)
* Optimize note model index

* enhance(backend): ANY()をやめる (MisskeyIO#239)

* add small e2e test drive endpoint

---------

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
2024-01-15 08:19:27 +09:00
zyoshoka d792f4f348
fix(backend): 虚無ノートを投稿できる問題の修正と `api.json` の OpenAPI Specification 3.1.0 への対応 (#12969)
* fix(backend): `text: null`だけのノートは投稿できないように

* add test

* Update CHANGELOG.md

* chore: bump OpenAPI Specification from 3.0.0 to 3.1.0

* chore: テストがすでにコメントで記述されていたのでそっちを使うことにする

* fix test

* fix(backend): prohibit posting whitespace-only notes

* Update CHANGELOG.md

* fix(backend): `renoteId`または`fileIds`(`mediaIds`)または`poll`が`null`でない場合に、`text  が空白文字のみで構成されたリクエストになることを許可して、結果は`text: null`を返すように

* test(backend): 引用renoteで空白文字のみで構成されたtextにするとレスポンスが`text: null`になることをチェックするテストを追加

* fix(frontend): `text`が`null`であって`renoteId`と`replyId`が`null`でないようなノートは引用リノートとして表示するように

* fix(misskey-js): OpenAPI 3.1に対応

* fix(misskey-js): 型生成をOpenAPI Specification 3.1.0に対応

* fix(ci): `validate-api.json`をOpenAPI Specification 3.1.0に対応

* fix(ci): スキーマ書き換えの際のミスを修正

* Revert "fix(frontend): `text`が`null`であって`renoteId`と`replyId`が`null`でないようなノートは引用リノートとして表示するように"

This reverts commit a9ca55343d.

* fix(misskey-js): `build-misskey-js-with-types`時は`api.json`のGETをスキップするように

* Revert "fix(misskey-js): `build-misskey-js-with-types`時は`api.json`のGETをスキップするように"

This reverts commit 865458989f.

* fix(misskey-js): `openapi-parser`で`validate`のかわりに`parse`を用いるように

* Update CHANGELOG.md
2024-01-13 16:54:25 +09:00
おさむのひと 35ec41fc1e
enhance(backend): テストの高速化 (#12939)
* enhance(backend): テストの高速化

* add ls

* 自動的にマージされるようなので不要

* 起動方法を揃える

* fix test
2024-01-08 17:43:52 +09:00
zyoshoka 618e2ba1d2
fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正 (#12923)
* fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正

* Update CHANGELOG.md

* refactor: `!== undefined` -> `!= null`

* add test
2024-01-08 17:40:37 +09:00
Kagami Sascha Rosylight 2a9db983fc
feat: export clips (#12931)
* feat: export clips

* Update CHANGELOG.md
2024-01-07 10:35:58 +09:00
おさむのひと 30311aca18
fix(misskey-js): /signupと/signinの定義を作成してフロントの型エラーを抑制する (#12846)
* fix(misskey-js): /signupと/signinの定義を復活してフロントの型エラーを抑制する

* fix ci

* fix ci

* fix

* fix

---------

Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com>
2024-01-03 13:41:28 +09:00
Kagami Sascha Rosylight ad346b6f36
feat(backend/oauth): allow CORS for token endpoint (#12814)
* feat(backend/oauth): allow CORS for token endpoint

* no need to explicitly set origin to `*`

* Update CHANGELOG.md
2023-12-27 15:10:24 +09:00
Chocolate Pie c96bc36fed
Merge pull request from GHSA-7pxq-6xx9-xpgm
* fix: fix improper authorization when accessing with third-party application

* refactor: refactor type definitions

* fix: get rid of unnecessary access limitation

* enhance: サードパーティアプリケーションがWebsocket APIを使えるように

* fix: add missing parentheses

* Revert "fix(backend): add missing kind definition for admin endpoints to improve security"

This reverts commit 5150053275.

* frontend: 翻訳の抜けを訂正, read:adminとwrite:adminはアクセス発行トークンのデフォルトでは非表示にする

* enhance(test): misskey-ghsa-7pxq-6xx9-xpgmに関するテストを追加

* enhance(test): Websocket APIに対するテストも追加

* enhance(refactor): `@/misc/api-permissions.ts`を`misskey-js/permissions`に統合

* fix(frontend): アクセストークン発行UIで全ての権限を有効にした際、管理者用APIへのアクセスも許可してしまう問題を修正

* enhance(backend): Websocketの接続に最低限必要な権限を変更

* fix(backend): `/api/admin/meta`をサードパーティアプリケーションからはアクセスできないように

* fix(backend): エンドポイントにアクセスするために必要な権限を変更

* fix(frontend/locale): Add missing type declaration

* chore: update `misskey-js/src/autogen`

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2023-12-27 15:08:59 +09:00
おさむのひと 433d46e57f
fix(backend): テストが死んでいるのを修正 (#12738)
* fix test

* fix test

* fix test

* fix test

* fix test
2023-12-22 09:06:13 +09:00
syuilo 15b0d2aff2
enhance: ロールにアサインされたときの通知 (#12607)
* wip

* Update misskey-js.api.md

* Update CHANGELOG.md

* Update RoleService.ts

* Update locales/ja-JP.yml

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>

* Update UserListService.ts

* Update misskey-js.api.md

* fix (#12724)

---------

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com>
2023-12-21 10:39:11 +09:00
Kagami Sascha Rosylight d14eb20122
chore(workflows): use postgres 15 everywhere (#12726) 2023-12-21 10:29:51 +09:00
zawa-ch 4e2d802967
enhance: “つながりの公開範囲”がフォロー・フォロワー個別設定できるように (#12702)
* Enhance: “つながりの公開範囲”がフォロー・フォロワー個別設定できるように (#12072)

* refactor: crowdin 編集部分のコミットを打ち消し

https://github.com/misskey-dev/misskey/pull/12702#issuecomment-1859417158

* refactor: オブジェクトの名前修正

https://github.com/misskey-dev/misskey/pull/12702#issuecomment-1859417158

* fix: 設定項目の説明を削除

名称が具体的になって必要なくなったため
https://github.com/misskey-dev/misskey/pull/12702#discussion_r1429932463
2023-12-18 20:59:20 +09:00
おさむのひと c68d87538a
リストタイムラインでミュートが貫通してしまう問題に対処 (#12534)
* ユーザリストTL系の各種動作を修正・統一

* fix

* fix CHANGELOG.md

* テスト追加
2023-12-03 10:19:37 +09:00
zyoshoka 3e0231d995
fix(backend): 何もノートしていないユーザーのフィードにアクセスするとエラーになる問題を修正 (#12455)
* fix(backend): 何もノートしていないユーザーのフィードにアクセスするとエラーになる問題を修正

* Update CHANGELOG.md

* add test

* fix: incorrect bob's username
2023-11-26 10:01:06 +09:00
anatawa12 864827f788
Hard mute (#12376)
* feat(backend,misskey-js): hard mute storage in backend

* fix(backend,misskey-js): mute word record type

* chore(frontend): generalize XWordMute

* feat(frontend): configure hard mute

* feat(frontend): hard mute notes on the timelines

* lint(backend,frontend): fix lint failure

* chore(misskey-js): update api.md

* fix(backend): test failure

* chore(frontend): check word mute for reply

* chore: limit hard mute count
2023-11-23 18:56:20 +09:00
syuilo 9d78a1a8b3 enhance(backend): make ftt db fallback configurable 2023-11-16 10:20:57 +09:00
zyoshoka aa6d0d4359
fix(backend): 非公開の投稿に対して返信できないように (#12333)
* fix(backend): 非公開の投稿に対して返信できないように

* Update CHANGELOG.md

* fix: test
2023-11-15 11:10:45 +09:00
syuilo e88dbad3cf tweak test 2023-11-01 15:56:57 +09:00
かっこかり 5fb6847419
Feat: 未読通知数を表示できるように (#11982)
* 未読通知数を表示できるように

* Update Changelog

* オプトインにする

* Fix lint

* (add) テスト通知のプッシュ通知を追加

* add test

* フロントエンドの表示上限を99に変更

* Make it default on

* 共通スタイルをくくりだす

* Update Changelog

* tweak

* Update UserEntityService.ts

* rename

* Update navbar-for-mobile.vue

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-11-01 13:34:05 +09:00
syuilo 9dcccbc8e1 fix(backend): 自分のフォローしているユーザーの自分のフォローしていないユーザーの visibility: followers な投稿への返信がストリーミングで流れてくる問題を修正
Fix #12117
2023-10-23 15:29:42 +09:00
syuilo e6c54de814 enhance(backend): RedisへのTLのキャッシュをオフにできるように 2023-10-23 15:17:25 +09:00
syuilo 5dc0463323 fix(backend): ローカルタイムラインに投稿者自身の投稿への返信が含まれない問題を修正 2023-10-22 16:23:50 +09:00
syuilo 72327716ca fix(backend): リストTLに自分のフォロワー限定投稿が含まれない問題を修正
Fix #12110
2023-10-22 10:40:53 +09:00
syuilo 2c0a139da6
feat: Avatar decoration (#12096)
* wip

* Update ja-JP.yml

* Update profile.vue

* .js

* Update home.test.ts
2023-10-21 18:38:07 +09:00
syuilo df957f7afe update test 2023-10-20 13:07:08 +09:00
syuilo b394328eb1 fix(backend): フォロ限へのリプのリプ元が(非公開)の表示のまま
Fix #12083
2023-10-20 11:58:09 +09:00
syuilo d962ea3889 add timeline tests 2023-10-20 08:15:31 +09:00
syuilo 683b71fc7e add timeline tests 2023-10-20 08:13:20 +09:00
syuilo 5b244cc6eb update test 2023-10-18 17:20:43 +09:00
syuilo 1966876320 fix test 2023-10-16 17:42:33 +09:00
syuilo 3ebed5aa3e feat: local-only antenna
Resolve #11869
2023-10-16 15:06:00 +09:00
syuilo 6a321ba340 fix test 2023-10-16 14:35:44 +09:00
syuilo 34d1b463a4 fix tests 2023-10-16 12:58:17 +09:00