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

fetchNewMessagesが最古のN件を取得している問題の修正 #4279

Merged
merged 2 commits into from
Sep 8, 2024

Conversation

ras0q
Copy link
Member

@ras0q ras0q commented May 21, 2024

close #3968
ref #4026
最新のfetchLimit件を作成日時昇順で取得するようにしました

Copy link

@cp-20
Copy link
Contributor

cp-20 commented Jul 7, 2024

手元で動作を確認したところ、もともと (現状のmasterブランチ) は最古のメッセージに飛ぶところが、このPRによって新しい方からn件目 (n = 一度に読み込むメッセージの数) に飛ぶようになっていますね

以下再現手順 (ローカルの開発環境でのみできます)

  1. DevToolsでNetworkをOfflineにする
  2. closeWs()関数を呼ぶ
  3. チャンネルを開く (この時点では回線がつながっていないのでロードされない)
  4. NetworkをNo Throttlingに戻す
  5. reconnectWs()関数を呼ぶ

Copy link
Contributor

@nokhnaton nokhnaton left a comment

Choose a reason for hiding this comment

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

良さそうです!

@ras0q
Copy link
Member Author

ras0q commented Jul 7, 2024

これをどうしようか悩んでいます
前のメッセージのキャッシュが残っているときに最新のメッセージを取得するとその間のメッセージを取得するトリガーがなくなってしまう
https://q.trap.jp/messages/496da103-0a53-475a-9683-5bc64247d9d9
https://q.trap.jp/messages/ccfc6d15-529b-408b-88b6-a966fa46f4cc

@ras0q
Copy link
Member Author

ras0q commented Sep 7, 2024

これ現状のtraQでチャンネル遷移するときにそのチャンネルのキャッシュが残ってることってありますか?
なかったらコメント残すくらいにしてこのPRはマージしてもOKですか @nokhnaton @cp-20

@cp-20
Copy link
Contributor

cp-20 commented Sep 7, 2024

APIにはキャッシュはかからないと思います (かかっていたとしてもETagでキャッシュしてそうなので大丈夫なはず) マージしてよさそうです

@ras0q ras0q changed the title 🐛 fetchNewMessages: fetch latest messages created_at asc fetchNewMessagesが最古のN件を取得している問題の修正 Sep 8, 2024
@ras0q ras0q merged commit 8bb76c7 into master Sep 8, 2024
10 checks passed
@ras0q ras0q deleted the fix/messages-order branch September 8, 2024 03:21
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