workbenchdev / Biblioteca

Documentation viewer for GNOME
GNU General Public License v3.0
54 stars 7 forks source link

Fast search on startup breaks app #90

Closed p3732 closed 6 months ago

p3732 commented 9 months ago

Hi, there seems to be a race condition upon startup, sometimes leading to a broken view state. It's not super easy to reproduce (I guess more likely on slower hardware?). Here are two different issues that can cause.

The first one simply an unfulfilled search. Nothing major, typing restarts the search.

Screencast from 08.01.2024 03:23:08.webm

The second case is worse, it leads to a completely broken view. This can only be fixed by opening a new tab and closing the old one.

Screencast from 08.01.2024 03:23:27.webm

I hope the descriptions help to locate the issue.

AkshayWarrier commented 9 months ago

Thanks for reporting the issue

Like you said, I'm having a hard time reproducing your issue and it may only happen on slower hardware. Biblioteca takes a second to completely load all the documentation so searching during that time may break something. A possible solution might be to decrease the load time (by saving and restoring the index from somewhere).

p3732 commented 8 months ago

I actually have decently fast hardware and the issue mostly occurs upon first starting of the app (before anything is cached), so reducing the load time of course sounds good, but I feel the true issue is a different one, one of threading.

Entered searches should probably not be executed until the view is loaded and vice versa the view should check for a queued search after it loaded.

sonnyp commented 8 months ago

Decreasing load time is always good but I agree it's not a proper solution to this problem.

I agree we should queue the search until what's necessary is loaded :+1:

sonnyp commented 6 months ago

@p3732 is it still a problem with 1.3?

p3732 commented 6 months ago

@sonnyp no, it seems fixed :)