-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(backend): チャンネルフォロー一覧のsinceId/untilIdによる絞り込みが上手く動いていないのを修正 #13698
base: develop
Are you sure you want to change the base?
fix(backend): チャンネルフォロー一覧のsinceId/untilIdによる絞り込みが上手く動いていないのを修正 #13698
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13698 +/- ##
============================================
- Coverage 77.99% 64.94% -13.06%
============================================
Files 185 986 +801
Lines 25454 111667 +86213
Branches 486 5703 +5217
============================================
+ Hits 19853 72522 +52669
- Misses 5594 37711 +32117
- Partials 7 1434 +1427 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら |
q.orderBy(`${q.alias}.id`, 'DESC'); | ||
q.andWhere(`${q.alias}.${targetColumn} > :sinceId`, { sinceId: sinceId }); | ||
q.andWhere(`${q.alias}.${targetColumn} < :untilId`, { untilId: untilId }); | ||
q.orderBy(`${q.alias}.${targetColumn}`, 'DESC'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SELECT
"MiChannelFollowing"."id" AS "MiChannelFollowing_id",
"MiChannelFollowing"."followeeId" AS "MiChannelFollowing_followeeId",
"MiChannelFollowing"."followerId" AS "MiChannelFollowing_followerId"
FROM
"channel_following" "MiChannelFollowing"
WHERE
"MiChannelFollowing"."followeeId" < $ 1
AND "MiChannelFollowing"."followerId" = $ 2
ORDER BY
"MiChannelFollowing"."followeeId" DESC
LIMIT
30
↑のような感じで、外から任意のIDカラムを条件として使用できるようにしました。
省略時は従来通りidを使います
channel.idをIDとして与えている箇所って具体的にどこかしら? |
見た感じバックエンドは現行の実装で何も問題なさそうだった |
(いまコメントに気が付いた) |
What
チャンネルのフォロー一覧を返すAPIにて、sinceId/untilIdの比較条件として与えているIDに間違いがあるのを直します(与えられているIDはchannel.idだが、比較先のIDはchannel_following.id)
これにより、チャンネルフォロー一覧から結果が抜け落ちる現象が改善されます。
Why
fix #12175
Additional info (optional)
実際にチャンネルを大量に作成&お気に入り登録し、歯抜けにならないことを確認。
Checklist