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

Fix avatar/banner proxy #8346

Merged
merged 8 commits into from
Feb 27, 2022
Merged

Conversation

tamaina
Copy link
Member

@tamaina tamaina commented Feb 23, 2022

Fix #7601
Fix #7602

#7767 を復活

What

Fix #7601
リモートファイルのプロキシオプションが、avatar/bannerに対して機能してないのを修正。
このオプションをDBに保存していると複雑になってしまうため、mediaProxyと同様にconfigに保存に変更になっています。

Fix #7602
avatar/bannerの非正規化カラムは削除/設定変更に追従出来ていないため、廃止してDriveFileを参照するようにしています。

Why

バグ修正

Additional info (optional)

tamaina and others added 3 commits February 23, 2022 13:40
@tamaina
Copy link
Member Author

tamaina commented Feb 23, 2022

例のごとくp1.a9z.devで試験中

Comment on lines 213 to 214
if (src.avatar === undefined && src.avatarId) src.avatar = await DriveFiles.findOne(src.avatarId) || null;
if (src.banner === undefined && src.bannerId) src.banner = await DriveFiles.findOne(src.bannerId) || null;
Copy link
Member

@syuilo syuilo Feb 23, 2022

Choose a reason for hiding this comment

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

タイムラインとか取得する場合だとクエリの数が結構増えてしまいそう
クエリのレイテンシが遅くて20ms程度ある環境を考えると 20 * 2(avatar, banner) * 2(リプライとか引用先のユーザー) * 10(タイムラインの投稿の数) = 800 でAPIのレスポンスが一秒くらい遅くなりそう

Copy link
Member

Choose a reason for hiding this comment

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

プロキシの設定はそんなに頻繁に変わらないと思うから長めにキャッシュしても良さそう

Copy link
Contributor

Choose a reason for hiding this comment

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

タイムラインAPIから呼ばれた時はsrc.avatarが既に入ってる前提だった気がする(覚えてない)

Copy link
Contributor

Choose a reason for hiding this comment

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

いやしてない。タイムラインクエリで User.avatar => DriveFile にJOINしないといけない。

@tamaina tamaina mentioned this pull request Feb 23, 2022
@tamaina
Copy link
Member Author

tamaina commented Feb 23, 2022

/avatarの動作を変える必要がある

@tamaina
Copy link
Member Author

tamaina commented Feb 23, 2022

いやないか?

@tamaina
Copy link
Member Author

tamaina commented Feb 23, 2022

うまく動いていなさそう

image

@tamaina
Copy link
Member Author

tamaina commented Feb 25, 2022

TypeORMわからん
(とりあえずコピペしただけだし)

@syuilo
Copy link
Member

syuilo commented Feb 27, 2022

引き継ぐわ

@syuilo syuilo self-assigned this Feb 27, 2022
@syuilo
Copy link
Member

syuilo commented Feb 27, 2022

とりあえずタイムライン系のAPIでJOINするようにした

@syuilo
Copy link
Member

syuilo commented Feb 27, 2022

うまく動いていなさそう

image

直した

@syuilo syuilo merged commit e314be5 into misskey-dev:develop Feb 27, 2022
@syuilo
Copy link
Member

syuilo commented Feb 27, 2022

🙏🏻🙏🏻🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants