-
Notifications
You must be signed in to change notification settings - Fork 130
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
[MM-62462] Plugin link tooltip for Jira plugin opens takes a very long time to load #1145
Open
M-ZubairAhmed
wants to merge
2
commits into
mattermost:master
Choose a base branch
from
M-ZubairAhmed:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4
−5
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does that mean we query the API on every mouseover?
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.
Yes, plugins can implement caching on their side to avoid repeated API calls if they want. However, from the webapp performance perspective, this component will get unmounted and remounted.
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.
Does the JIRA plugin implement such caching? In other words, does the tooltip load as quickly as before the webapp before on the 2nd mouseover?
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.
It loads depending on the network request resolution. Does that answer your question?
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.
Not quite. Previously (If I remember correctly), the webapp would only make one network request per link. Is that still the case? I'm concerned about the number of API requests we make to JIRA, which has caused issues in the past.
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.
There was no caching mechanism in place previously, and that remains the case. The webapp still makes a single request per link. However, the performance improvement from the new implementation — particularly by preventing memory leaks present in the previous approach — far outweighs the impact of this minor change.
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.
Testing it on Hub, the current version sort of implicitly caches these because the
TicketPopover
stays mounted for as long as the user keeps a channel, so it'll only load once per channel switch when the user mouses over a Jira link. The same applies to links on posts in the RHS or Threads view.If I'm reading the code right, the new logic will make the
TicketPopover
remount any time the user mouses over and off of a link, so it will make more requests, but I'm not sure how meaningful of a difference that will be unless a user repeatedly does that on purpose. It would be more impactful for keyboard users tabbing over the elements which I'm hesitant to downplay given our focus on accessibility, but I don't know how common that actually is.Ideally, I think this would be addressed in the Jira plugin by caching it since it's kind of a happy accident that it "cached" data as well as it did before. This is yet another case where loading and caching data effectively is hard.
Overall, I think it's still worth it to make this change to address the side effect of the memory leak despite the potential increase in the number of requests, but I think it'd be good to schedule a followup ticket to improve the caching on the plugin side
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.
Ticket created: https://mattermost.atlassian.net/browse/MM-62571