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

When searching for album/artist/etc, shown result may match previous query #645

Open
josteink opened this issue Mar 21, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@josteink
Copy link

Consider the following example:

I want to listen to the album "Xen cuts", a compilation album from Ninja Tune label. I open FinAmp, click "Albums" tab, and enter "X", "e" and "n", forming the saerch "Xen". I'm a fast typer, so I manage to type the "n" before the search results from "Xe" is fully returned.

When I'm done typing "Xen", the search results looks like this:
image

What we're looking at here is probably the search results for "Xe", not "Xen".

As a programmer, I would assume the following has happened:

  • I type "X", a search-request is issued (Req1)... awaiting the response Res1.
  • I type "e", a search-request is issued (Req2)... awaiting the response Res2.
  • Response Res1 is received, UI is updated, regardless.
  • I type "n", a search-request is issued (Req3) is issued... awaiting the response Res3.

Now here's what I belive is the juicy bit.

Req2 will probably take more time to execute and return a bigger result set than Req3, because Req3 by definition is narrower. This means that Req3, despite being issued later, may actually return earlier than Req2.

Which if I'm correct yields the following:

  • Response Res3 is received before Res2, UI is updated, regardless.
  • Response Res2 is received, UI is updated, regardless, even though this was not the latest search.

What I as a user expect is that the result shown always matches the latest search.
Basically when a new search query is issued, the response from all previous search queries should be disregarded.

@Komodo5197
Copy link

Is this in 0.6.2? Because I think the redesign beta should have a fix for this already.

@josteink
Copy link
Author

This is 0.6.20 on MacOS, yes.

Whats the best way for me to test the beta redesign?

@Chaphasilor
Copy link
Collaborator

Yeah this isn't fixed in the beta either. I have to work around it myself quite often, where I just wait with the final character until after the search results loaded, and then enter it to trigger a new search.

I'm definitely planning to fix that, but will probably only do this as part of the general search overhaul (so search isn't tied to specific categories by default anymore). If I have the time and motivation I might try to fix this earlier, but I can't say for sure.
I'd be happy to accept a nice pull request though!

@Chaphasilor Chaphasilor added the bug Something isn't working label Mar 21, 2024
@Komodo5197
Copy link

@Chaphasilor Are you sure? I tried to fix this when I was reworking the music screen paging in the downloads rewrite, and I can't recreate this on 0.9.3.

@Chaphasilor
Copy link
Collaborator

Oh! No I'm not sure, and I completely missed those changes. I'll try not updating my search in the coming days to see if it works or not :D

@Chaphasilor
Copy link
Collaborator

@Komodo5197 you're right, the bug with old search results popping up isn't there anymore. But to me it feels much slower than before. I'll keep an eye on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants