Conversation
Typing a query like "Nirvana" in the music search bar returned results for just "N". Every keystroke called PagingController.refresh(), but infinite_scroll_pagination coalesces refreshes for the same page key: while a "page 0" request is in flight it issues no new request. As a result only the first keystroke's term was ever fetched, and its (first-letter) results were all that showed once the slow response arrived. Debounce the search field so a single query is issued for the final term once the user pauses typing, instead of one request per keystroke. As a safety net for burst typing (a pause mid-word can still start a request for a partial term while a later refresh gets coalesced away), _getPage now appends the response before checking staleness and, if the term changed while the request was in flight, triggers a refresh so the current term actually gets fetched. Appending first is required: the controller won't issue a new request until the in-flight one completes, so dropping the result would leave the list stuck on a spinner. Fixes finamp-app#1729
Member
|
@csaavedra hey, thanks for the fix but this should already be fixed on the |
Author
|
No, I haven't. I am reluctant to use "beta"-tagged software. I guess I will wait until the end of the month; I am using my own build with this fix in the meantime. |
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.
Typing a query like "Nirvana" in the music search bar returned results for just "N". Every keystroke called PagingController.refresh(), but infinite_scroll_pagination coalesces refreshes for the same page key: while a "page 0" request is in flight it issues no new request. As a result only the first keystroke's term was ever fetched, and its (first-letter) results were all that showed once the slow response arrived.
Debounce the search field so a single query is issued for the final term once the user pauses typing, instead of one request per keystroke.
As a safety net for burst typing (a pause mid-word can still start a request for a partial term while a later refresh gets coalesced away), _getPage now appends the response before checking staleness and, if the term changed while the request was in flight, triggers a refresh so the current term actually gets fetched. Appending first is required: the controller won't issue a new request until the in-flight one completes, so dropping the result would leave the list stuck on a spinner.
Fixes #1729