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

[$250] [HOLD for payment 2024-10-17] Report actions pagination improvements #41153

Closed
janicduplessis opened this issue Apr 27, 2024 · 36 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.

Comments

@janicduplessis
Copy link
Contributor

janicduplessis commented Apr 27, 2024

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 OwnerCurrent Issue Owner: @
Copy link

melvin-bot bot commented May 3, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Jul 15, 2024

@janicduplessis, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

@melvin-bot melvin-bot bot closed this as completed Jul 15, 2024
@roryabraham roryabraham reopened this Aug 16, 2024
@roryabraham roryabraham self-assigned this Aug 16, 2024
@roryabraham roryabraham added Weekly KSv2 Improvement Item broken or needs improvement. and removed Monthly KSv2 Not a priority labels Aug 16, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 26, 2024
@roryabraham
Copy link
Contributor

put a PR in review for this: https://github.com/Expensify/Auth/pull/12239

@melvin-bot melvin-bot bot removed the Overdue label Aug 27, 2024
@roryabraham roryabraham added the Reviewing Has a PR in review label Aug 27, 2024
@janicduplessis
Copy link
Contributor Author

@roryabraham Awesome, let me know when this is merged I could work on the app integration.

@roryabraham
Copy link
Contributor

It's merged, should be deployed within the next 2-3 hours. I'll let you know

@roryabraham
Copy link
Contributor

FWIW, I made the following changes:

  1. GetOlderActions includes a hasOlderActions key in the response
  2. GetNewerActions includes a hasNewerActions key in the response
  3. If called with an "anchor" reportActionID, OpenReport includes both hasOlderActions and hasNewerActions

I'll test this locally and make sure it's working. Might need to make some changes in our "middle" PHP layer to make sure the data makes it to the front-end in the response.

@roryabraham
Copy link
Contributor

roryabraham commented Aug 28, 2024

Tested it and the new keys are not making it to the front-end. Looks like I'll need another PR in the PHP layer, but should be simple

@roryabraham
Copy link
Contributor

For GetOlderActions and GetNewerActions it's an easy change. For OpenReport, not so much because there's a lot happening in the PHP layer and I might need to refactor some PHP functions that are used in many locations.

Alternatively, I can try to refactor OpenReport to be what we call 1:1:1 (or 1 user action = 1 php API call = 1 C++ Auth/DB command). That would likely take me several days. Will probably chat internally about the best path forward

@janicduplessis
Copy link
Contributor Author

If called with an "anchor" reportActionID, OpenReport includes both hasOlderActions and hasNewerActions

I think OpenReport should always include hasOlderActions even with no anchor since for a small chat there might be no older messages to load initially.

@roryabraham
Copy link
Contributor

Good point, I'll work on adjusting that, as soon as I figure out what to do with the OpenReport

@roryabraham roryabraham removed the Reviewing Has a PR in review label Aug 28, 2024
@roryabraham
Copy link
Contributor

roryabraham commented Sep 2, 2024

I've spent a lot of time working on this. I do just need a single PHP PR, but it involves ripping out some deprecated code that has a lot of hidden side-effects. So it's been much more challenging than it seemed like it should have been.

At this point I have only one failing test that I'm trying to wrap my head around

@melvin-bot melvin-bot bot added the Overdue label Sep 10, 2024
@roryabraham
Copy link
Contributor

Still stuck on that PR, but have been driving myself crazy trying to figure it out. Pushed a few changes that I think are sound, but still haven't gotten the last test passing.

Copy link

melvin-bot bot commented Oct 10, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 10, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.47-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-17. 🎊

For reference, here are some details about the assignees on this issue:

@rlinoz
Copy link
Contributor

rlinoz commented Oct 11, 2024

I guess we need a BZ here

@rlinoz rlinoz added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 11, 2024
Copy link

melvin-bot bot commented Oct 11, 2024

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 11, 2024
@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Oct 14, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-17] Report actions pagination improvements [$250] [HOLD for payment 2024-10-17] Report actions pagination improvements Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021845841739039769728

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

Current assignee @ishpaul777 is eligible for the External assigner, not assigning anyone new.

@CortneyOfstad CortneyOfstad removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 14, 2024
@CortneyOfstad
Copy link
Contributor

@ishpaul777 — sent you an offer in Upwork, please let me know once you accept!

@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2024
@ishpaul777
Copy link
Contributor

Accepted Thanks!

@CortneyOfstad
Copy link
Contributor

I am heading OoO (10/15 to 10/23), so going to get this reassigned so the payment can be made!

@CortneyOfstad CortneyOfstad removed their assignment Oct 15, 2024
@CortneyOfstad CortneyOfstad added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@CortneyOfstad CortneyOfstad self-assigned this Oct 15, 2024
@lschurr
Copy link
Contributor

lschurr commented Oct 15, 2024

Payment summary:

@lschurr
Copy link
Contributor

lschurr commented Oct 15, 2024

Oops I read the date wrong and paid it today. We'll just leave this open to make sure there are no regressions.

@lschurr
Copy link
Contributor

lschurr commented Oct 17, 2024

Closing :)

@lschurr lschurr closed this as completed Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

6 participants