Open anatawa12 opened 3 months ago
Attention: Patch coverage is 13.33333%
with 52 lines
in your changes missing coverage. Please review.
Project coverage is 40.07%. Comparing base (
8b4933c
) to head (bb92129
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
ちょっとoutofscopeかもしれないけどrefactorついでにpolicyでrateLimitFactorを調整すると 回数だけではなく時間も影響されて実際の影響が倍になる問題を直したほうがいいかもしれません (durationとmax両方でfactorをかけ算/割り算するのではなくmaxにだけ割り算した方が良さそう)
実際の影響が倍になる
正確には2乗に比例するはずです。
mark this pull request as "ready for review": #13994 is merged
ちょっとoutofscopeかもしれないけどrefactorついでにpolicyでrateLimitFactorを調整すると 回数だけではなく時間も影響されて実際の影響が倍になる問題を直したほうがいいかもしれません (durationとmax両方でfactorをかけ算/割り算するのではなくmaxにだけ割り算した方が良さそう)
実装しました
lint 👀
IDEのeslintがコンフィグのロードに失敗してましたすみません
あ、セマンティックコミットじゃない 🙇🏻
レートリミットのfactorが二回適用されて二乗の効果がある問題を修正
これは意図した挙動だった
これは意図した挙動だった
二乗の効果にした意図は何なのでしょうか
強さを変更したらdurationも変わる方が自然に思った(別に「factor」は回数のみに影響するとは決まっていない)
強さが線形(2倍にしたら2倍アクセスできる)のほうが私は直感的だと私は思いました。(少なくとも過去の自分は線形の影響度を持つと解釈してました。) 今回の変更では回数を変更しましたが、durtionをfactor倍するのでも私はいいと思っています。
また、両方に影響するべきという話であれば、今の実装以外の線形の方法としてはsqrt(factor)をdurationも回数も影響させるというのが実装可能だと思います。
What
https://github.com/misskey-dev/misskey/pull/13994#issuecomment-2167357285
を実装しました
Why
What参照
Additional info (optional)
diffとしては大きいですが、小さな作業単位にcommitを分けたので、レビューするときはコミット単位にみてもらうとおそらく見やすいと思います。
13994を先にマージする必要があるため、マージされるまでDraftにしますが Ready for Review です
Checklist