Flow.Launcher.Plugin.Notion icon indicating copy to clipboard operation
Flow.Launcher.Plugin.Notion copied to clipboard

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

Open enoversum opened this issue 1 year ago • 4 comments

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.

enoversum avatar Nov 12 '24 10:11 enoversum

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.

AminSallah avatar Nov 13 '24 22:11 AminSallah

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.

https://github.com/user-attachments/assets/166e8deb-816a-47da-87c4-ec55f004ec03

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.

enoversum avatar Nov 13 '24 22:11 enoversum

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.

AminSallah avatar Nov 14 '24 00:11 AminSallah

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.

enoversum avatar Nov 14 '24 09:11 enoversum