Problem
We currently have an issue where pagination methods (GetNewerActions, GetOlderActions) are called unconditionally even if we should know that no newer or older messages are available.
Solution
To improve this OpenReport, GetNewerActions, GetOlderActions should all return pagination info. This should be stored in the REPORT_METADATA onyx collection.
- For
OpenReport it should be hasNewerActions and hasOlderActions.
- For
GetNewerActions it should be hasNewerActions.
- For
GetOlderActions it should be hasOlderActions.
Then in loadNewerChats and loadOlderChats we should check that newer / older actions are available before loading them.
This will reduce the call to these methods significantly. For regular chats we never should have newer actions since we start loading from the start of the chat so GetNewerActions will never be called. If we are in a short chat, we probably loaded all messages initially so we don't need to call GetOlderActions. For comment linking we should still call both GetNewerActions and GetOlderActions since we are probably in the middle of a chat.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021845841739039769728
- Upwork Job ID: 1845841739039769728
- Last Price Increase: 2024-10-14
Issue Owner
Current Issue Owner: @
Problem
We currently have an issue where pagination methods (
GetNewerActions,GetOlderActions) are called unconditionally even if we should know that no newer or older messages are available.Solution
To improve this
OpenReport,GetNewerActions,GetOlderActionsshould all return pagination info. This should be stored in theREPORT_METADATAonyx collection.OpenReportit should behasNewerActionsandhasOlderActions.GetNewerActionsit should behasNewerActions.GetOlderActionsit should behasOlderActions.Then in
loadNewerChatsandloadOlderChatswe should check that newer / older actions are available before loading them.This will reduce the call to these methods significantly. For regular chats we never should have newer actions since we start loading from the start of the chat so
GetNewerActionswill never be called. If we are in a short chat, we probably loaded all messages initially so we don't need to callGetOlderActions. For comment linking we should still call bothGetNewerActionsandGetOlderActionssince we are probably in the middle of a chat.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @