Skip to content

Fix temp files deleting issue & Validate the cache directory before loading all bookmarks #3535

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

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,17 @@ private void LoadFaviconsFromDb(string dbPath, List<Bookmark> bookmarks)
}
catch (Exception ex)
{
File.Delete(tempDbPath);
try
{
if (File.Exists(tempDbPath))
{
File.Delete(tempDbPath);
}
}
catch (Exception ex1)
{
Main._context.API.LogException(ClassName, $"Failed to delete temporary favicon DB: {tempDbPath}", ex1);
}
Main._context.API.LogException(ClassName, $"Failed to copy favicon DB: {dbPath}", ex);
return;
}
Expand Down
5 changes: 3 additions & 2 deletions Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public void Init(PluginInitContext context)
context.CurrentPluginMetadata.PluginCacheDirectoryPath,
"FaviconCache");

FilesFolders.ValidateDirectory(_faviconCacheDir);

LoadBookmarksIfEnabled();
}

Expand All @@ -50,6 +48,9 @@ private static void LoadBookmarksIfEnabled()
return;
}

// Validate the cache directory before loading all bookmarks because Flow needs this directory to storage favicons
FilesFolders.ValidateDirectory(_faviconCacheDir);

_cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
_ = MonitorRefreshQueueAsync();
_initialized = true;
Expand Down
Loading