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

Look into making report display name generation more efficient #11609

Closed
tgolen opened this issue Oct 5, 2022 · 15 comments
Closed

Look into making report display name generation more efficient #11609

tgolen opened this issue Oct 5, 2022 · 15 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Improvement Item broken or needs improvement. Reviewing Has a PR in review

Comments

@tgolen
Copy link
Contributor

tgolen commented Oct 5, 2022

Coming from #11226 (comment)

Problem

There is code that generates the display name of a report. This code may be non-performant at scale and turn into a bottle neck.

Solution

Consider some solutions:

  1. memoizing the report name generation
  2. generating the display name on the server
  3. storing the displayName in a map instead of cloning the reports in a map

@marcaaron I'm particularly interested in your thoughts on solution 2. The report name will only change when:

  1. The participants change (I don't think we ever change participants... We either archive the report or create a new report when adding participants
  2. The type of chat report changes (I don't think it's possible to change the type of a chat report)
  3. The chat is archived (valid reason)
  4. The details of the participants change (valid reason)

Because of point 4, maybe that's the best reason to keep the display name generation on the client and to use solution 1 or 3 above?

@tgolen tgolen added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Oct 5, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2022

Triggered auto assignment to @michaelhaxhiu (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@melvin-bot melvin-bot bot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Oct 5, 2022
@michaelhaxhiu
Copy link
Contributor

@tgolen would it be best to close this for and make an #expensify-open-source discussion/proposal? And then depending on what we discover there, we create a GH to handle next steps?

Just asking because as a triager, I'm struggling to assess my next step until this is definitively framed as a bug or newfeaure.

@michaelhaxhiu
Copy link
Contributor

An alternative is to un-assign triage until it's ready for being pushed through the assignment flow. I'll leave it assigned for a few days till you have a moment to consider.

@michaelhaxhiu michaelhaxhiu removed the Daily KSv2 label Oct 5, 2022
@marcaaron
Copy link
Contributor

marcaaron commented Oct 5, 2022

@tgolen report names can also be changed manually (in the case of user created rooms) so I'd add that case to the list

I like the idea of sending this from the backend as a new reportDisplayName field. Since we do not yet notify people in realtime when personal details change I don't think we can really do much about that point (until we have realtime updating of details and then should also update the report names when they change).

Overall, I think it is reasonable to send an updated reportDisplayName whenever one of the other things on your list happens.

@melvin-bot melvin-bot bot added the Monthly KSv2 label Oct 10, 2022
@tgolen
Copy link
Contributor Author

tgolen commented Oct 10, 2022

@michaelhaxhiu I think this is just a cleanup task that I'll work on internally. Sorry, I usually remember to omit the AutoAssignerTriage label when I do that :D

@tgolen tgolen assigned tgolen and unassigned michaelhaxhiu Oct 10, 2022
@tgolen tgolen added Improvement Item broken or needs improvement. Engineering labels Oct 10, 2022
@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@tgolen tgolen added the Reviewing Has a PR in review label Nov 2, 2022
@melvin-bot

This comment was marked as duplicate.

1 similar comment
@melvin-bot

This comment was marked as duplicate.

@melvin-bot
Copy link

melvin-bot bot commented Nov 4, 2022

BugZero Checklist: The PR fixing this issue has been merged! The following checklist will need to be completed before the issue can be closed:

The top for items here are N/A since this issue was not a bug and therefore would not have any regression linked to it.

  • N/A A regression test has been added or updated so that the same bug will not reach production again. Link to the updated test here:
  • N/A The PR that introduced the bug has been identified. Link to the PR:
  • N/A The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • N/A A discussion in #contributor-plus has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • Payment has been made to the issue reporter (if applicable)
  • Payment has been made to the contributor that fixed the issue (if applicable)
  • Payment has been made to the contributor+ that helped on the issue (if applicable)

@melvin-bot
Copy link

melvin-bot bot commented Nov 5, 2022

⚠️ 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.

@tgolen
Copy link
Contributor Author

tgolen commented Nov 7, 2022

Yeah, I confirmed that the PR from this caused the regression. It was a spot I missed in the code when I changed a method signature.

@tgolen tgolen added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 21, 2022

Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Monthly KSv2 labels Nov 21, 2022
@tgolen
Copy link
Contributor Author

tgolen commented Nov 21, 2022

I'm reassigning the bug label to have someone from the BZ team close this out.

@NicMendonca
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:

@tgolen is there a PR that would have introduced this GH?

@melvin-bot
Copy link

melvin-bot bot commented Nov 30, 2022

@tgolen, @NicMendonca Whoops! This issue is 2 days overdue. Let's get this updated quick!

@tgolen
Copy link
Contributor Author

tgolen commented Nov 30, 2022

Sorry @NicMendonca I missed the updates to this. I think this issue is a little confusing. For the purposes of closing this out, this issue was not a bug and so there could be no regression. It was just a code cleanup. I think for the BugZero checklist, the remaining checkboxes are all "N/A" and it's OK to close this.

@tgolen tgolen closed this as completed Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Improvement Item broken or needs improvement. Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

5 participants