Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not save files on uploder's drive when adding custom emojis. カスタム絵文字を追加する際にユーザーのドライブには保存しない #9526

Open
atsu1125 opened this issue Jan 12, 2023 · 6 comments
Labels
✨Feature This adds/improves/enhances a feature packages/backend Server side specific issue/PR

Comments

@atsu1125
Copy link
Contributor

Summary

Misskey v12からカスタム絵文字を追加する際にはユーザーのドライブにファイルをアップロードしてから、登録するようになっている。
カスタム絵文字を追加したユーザーがアカウント削除するとドライブのファイルが削除されることから、当該カスタム絵文字の画像ファイルを参照できなくなる。
このためカスタム絵文字はユーザーのドライブではなく、何らかの専用領域に保管するようにすることが望ましい。
ワークアラウンドとしてMisskey v11のようにカスタム絵文字をURIで登録できるようにするのも考えられる。

Starting with Misskey v12, when adding a custom emoji, a file must be uploaded to the user's drive before it can be registered. When a user who has added a custom pictogram deletes his/her account, the file on the drive is deleted, and the image file of the custom emoji can no longer be referenced.
For this reason, it is recommended that custom emoji be stored in some dedicated area, not in the user's drive.
As a work-around, custom emoji could be registered by URI, as in Misskey v11.

@atsu1125 atsu1125 added the ✨Feature This adds/improves/enhances a feature label Jan 12, 2023
@syuilo syuilo added the packages/backend Server side specific issue/PR label Jan 12, 2023
@atsu1125
Copy link
Contributor Author

This idea cloud resolve this issue. #5695

@nafu-at
Copy link
Contributor

nafu-at commented Aug 17, 2023

このIssueはかなり重要度が高い問題のように思います。
私が運営するサーバーでもこの問題に起因するリンク切れが多発しています。
(関連:#10576

また、CDN等でキャッシュを行っている場合、問題発生から発覚までに時間を要することもあり、
発覚までの間ローカル内において絵文字として通常使用が可能なことで、被害の拡大(絵文字が正常に表示されないノートの多発)を引き起こすこととなっています。

対策として

  • 絵文字登録時にシステム管理のファイルに置き換える仕組みにする
  • ユーザーが削除可能な仕様を保持する場合、ドライブのファイルを削除した時点で絵文字登録からも削除されるようにする
    • 絵文字で使われているファイルであることがわかるような表示を行う(アイコンやヘッダーのような)
    • ファイルの削除を行う際に警告の表示を行う

などが考えられるかと思います。
こちらご検討いただけますと幸いです。

@tamaina
Copy link
Member

tamaina commented Aug 17, 2023

カスタム絵文字インポートはuser: nullで登録されるのでこういった問題は起きない
(のでuser: nullなドライブファイルとして登録しなおせば良い)

@fruitriin
Copy link
Contributor

知見

@tamaina
Copy link
Member

tamaina commented Aug 17, 2023

(というかCustomEmojiService.add,updateへはfile pathを渡すようにしてその中でuser: nullでアップロードするとかにしたほうが良さそう)

@Sayamame-beans
Copy link
Member

Misskey側で保持している/させたい画像を、モデレーター/管理者共用のドライブのような形で参照出来ると良さそうな感じが少ししました
微related: #12301 #13744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature packages/backend Server side specific issue/PR
Projects
Status: Todo
Status: No status
Development

No branches or pull requests

6 participants