-
-
Notifications
You must be signed in to change notification settings - Fork 448
Fix index out of range error for FireFox bookmarks loading #3659
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
Conversation
🥷 Code experts: onesounds, Yusyuriv Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
1 similar comment
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThe change updates the Firefox bookmark loader logic to robustly handle both relative and absolute profile paths when locating the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FirefoxBookmarkLoader
User->>FirefoxBookmarkLoader: GetBookmarks()
FirefoxBookmarkLoader->>FirefoxBookmarkLoader: Parse profiles.ini
FirefoxBookmarkLoader->>FirefoxBookmarkLoader: Identify default profile
FirefoxBookmarkLoader->>FirefoxBookmarkLoader: Check IsRelative attribute
FirefoxBookmarkLoader->>FirefoxBookmarkLoader: Resolve places.sqlite path (relative/absolute)
FirefoxBookmarkLoader-->>User: Return bookmarks
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs (2)
273-273
: Remove the empty XML documentation tag.The empty
<remarks></remarks>
tag doesn't provide any documentation value and should be removed.- /// <remarks></remarks>
328-329
: Fix typo and consider clearer variable naming.There's a typo in
absoluePath
which should beabsolutePath
. Also consider more descriptive variable names sincerelativePath
isn't actually relative.- var relativePath = Path.Combine(defaultProfileFolderName, "places.sqlite"); - var absoluePath = Path.Combine(profileFolderPath, relativePath); + var placesInProfile = Path.Combine(defaultProfileFolderName, "places.sqlite"); + var absolutePath = Path.Combine(profileFolderPath, placesInProfile);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: gitStream workflow automation
- GitHub Check: gitStream workflow automation
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: build
- GitHub Check: Check Spelling
🔇 Additional comments (2)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs (2)
299-325
: Excellent documentation of Firefox profile structure.These comprehensive comments significantly improve code maintainability by clearly explaining the Firefox profiles.ini structure and the various scenarios the code needs to handle.
331-337
: Solid boundary check to prevent index out of range errors.This correctly addresses the core issue by checking bounds before accessing the array. The fallback logic using
Directory.Exists
is a reasonable approach for handling edge cases.
Resolve #3109.