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

Improvement: Don't cache whole database on each FlowLauncher start #18

Open
enoversum opened this issue Nov 12, 2024 · 4 comments
Open

Comments

@enoversum
Copy link

Hey there, I'm still using and enjoying your Notion plugin almost every day.

What I found a bit distracting is that each time FlowLauncher has been re-started, hitting your keyword requires me to wait for quite some time until the plugin finishes re-downloading of what seems the whole of my page titles and icons.
It would be beautiful if I could start from the cached results off my FlowLauncher installation, while the plugin scans for changes in the background. This way, I'd be able to use it right away, while newer pages would appear when the plugin successfully queried and processed the new data.

@AminSallah
Copy link
Owner

Hi @enoversum, nice to see you back! The plugin doesn't block the main process. It refreshes the cache in the background on a separate thread and use the latest cache found, The user shouldn't notice this unless they trigger the plugin while applying the new cache (which is rare). If so the user will see an error, not a loading bar. The delay or loading bar you see comes from Flow Launcher itself, not the plugin. Flow Launcher caches the entire set of results and images, which is generally very fast—unless you have an unusually large number of results to cache.

@enoversum
Copy link
Author

Hi @AminSallah , and lovely to hear back from you as well 😊.
I can only speak for my personal Notion, and what I observe is that when FlowLauncher has started up, if I hit the shortcut, it will start loading, and would at times even freeze FlowLauncher entirely when fetching results. I'm pretty sure I didn't change anything to your plugin, so this is normal behaviour since the beginning for me.
I use Notion very intensely, with a big database with code snippets and a few lighter databases on top. It might just be that my content needs too long to cache properly? I'm on 5.0.1, which seems to be the latest version.

Spark_Desktop_.Beta._i1A9dbSlcs.mp4

This is after I restarted FlowLauncher. When I just hit the shortcut (n for me), I usually have to wait for quite some time until it produces a result on its own. I believe I don't have to leave FL visible for that, but I can't do any searches until the plugin finished re-caching the results. It would be great if your plugin could just use the old cache, and once it finished re-downloading the new one, replace the old with the new one. If that makes any sense.

@AminSallah
Copy link
Owner

It would be great if your plugin could simply use the old cache and, once it finishes re-downloading the new one, replace the old cache with the new one.

That's exactly what the plugin does.
The issue you're facing is most likely related to the FL launcher limitations. To rule out whether the issue is with the Notion plugin itself, could you try turning off your internet connection and then restart FL? This should prevent the plugin from refreshing the cache. If the issue persists, it suggests that the problem lies with the Flow Launcher itself, not the plugin.
Also, could you let me know how many pages you’ve shared with the token? You can find this by triggering the plugin and opening the context menu of any page. The number of pages will be displayed in brackets next to the Hide ALL current query ( ) option.

@enoversum
Copy link
Author

Well, I disabled my internet connection and tried the plugin again, and as you said, it's using the cache instead of trying to pull new data. Not when I'm connected to the web, then I can't do a search while it pulls and pulls and pulls…
The query is for 1744 pages, my context menu tells me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants