Repository navigation
Request the build feed page once - #612
Merged
Merged
Conversation
Opening the build feed loaded the page directly in created() and once more from the buildFeedQuery watcher, and applying a search updated the filter from the search form and then again from the new route, so every page load and search sent the same request twice. With heavy searches the two copies slowed each other down. Don't send a request while the same one is still running, and ignore the response of a request that a newer one has replaced, so a slow search can't overwrite the results of the next one.
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.
Problem
The build feed sends every request twice:
/callsloadFeedPage()directly increated(), andupdateFilter()right before it stores a new filter object, so thebuildFeedQuerywatcher loads the page once more;/search?..., where the$route.querywatcher stores the same filter again and the page is loaded again.Both copies are identical. On production a
project=bashsearch took 3.5 s and 6.2 s for the two copies competing with each other.Fix
loadFeedPage()doesn't send a request while the same one is still running. The response of a request that a newer one has replaced is ignored, so a slow search can no longer overwrite the results of the next search.Requests that differ, or the same request sent after the previous one has finished (e.g. applying the same search again to refresh the feed), are sent as before.
Checks
In the browser against production data (read-only), counting
/api/v1/builds/requests:/project=bashfrom the search form/search?projectName=kernelSearching
bashand thenkernel-rt0.3 s later: thebashresponse came after thekernel-rtone and the feed kept thekernel-rtresults.🤖 Generated with Claude Code