Merged
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
JammingBen
approved these changes
Feb 9, 2021
Contributor
JammingBen
left a comment
There was a problem hiding this comment.
Didn't know that namespacing jQuery-events is a thing, cool stuff 👍
Contributor
|
Looks good. Fixes #37085 |
AlexAndBear
reviewed
Feb 9, 2021
b44a705 to
988c7cf
Compare
AlexAndBear
approved these changes
Feb 9, 2021
|
Kudos, SonarCloud Quality Gate passed! |
Contributor
|
This patch was provided to a customer because of potential query optimization in https://github.com/owncloud/enterprise/issues/4374 The customer now reports that they discovered that they had to revert the patch, because the page "Shared with you" would no longer show all shares. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Prevent the registration of the same event listener several times, which causes the same action (from the duplicated listeners) to be performed multiple times.
Primary problem is with the "urlChanged" event, which causes an ajax request to be thrown. This means that, without this fix, the ajax requests performed were increasing along with the increasing event listeners being registered for that event.
The other events don't seem to be too critical since the attached action is pretty light.
Related Issue
Helps with https://github.com/owncloud/enterprise/issues/4374
Motivation and Context
No need to register the same event listener twice
How Has This Been Tested?
Mostly tested going back and forth between the "all files" and "shared with you" sections in the files view, as well as checking there is no apparent problem with the scrolling in those sections.
Event registration has been checked with the firefox dev tools, ensuring there is no increasing event associated with the target web element. There could be multiple listeners for the same event, but it's expected to be for different purposes (not duplicated)
Screenshots (if appropriate):
Types of changes
Checklist: