-
-
Notifications
You must be signed in to change notification settings - Fork 446
Fix WebSearch plugin crash from certain Uri paths #3639
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
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.
Pull Request Overview
This PR addresses the web search issue by improving error handling for browser operations.
- Wraps calls to OpenInBrowserTab and OpenInBrowserWindow in a try-catch in PublicAPIInstance.cs
- Updates the browser error message text in Languages/en.xaml
- Refactors SearchWeb.cs with updated C# syntax and using statement ordering
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
Flow.Launcher/PublicAPIInstance.cs | Wraps browser-opening calls in a try-catch block to handle and log exceptions |
Flow.Launcher/Languages/en.xaml | Adds a new error message string for browser open failures |
Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs | Updates syntax (e.g., slicing operator) and using statement ordering for clarity |
Comments suppressed due to low confidence (1)
Flow.Launcher/Languages/en.xaml:476
- [nitpick] Consider revising the error message text for clarity and consistency (e.g., 'An error occurred while opening the URL in the browser. Please check your default web browser settings on the General page.').
<system:String x:Key="browserOpenError">An error occurred while opening the url in browser. Please check your setting in Default Web Browser of general page.</system:String>
🥷 Code experts: onesounds, jjw24 Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
1 similar comment
🥷 Code experts: onesounds, jjw24 Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
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. |
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughThe changes introduce improved error handling when opening URLs in the browser. A fallback mechanism is added to attempt direct URL opening if the initial browser launch fails, and a user-facing error message is displayed when both attempts fail. Additionally, a new localized error string is added for user notification. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PublicAPIInstance
participant SearchWeb
participant OS
User->>PublicAPIInstance: OpenUri(uri)
PublicAPIInstance->>SearchWeb: OpenInBrowserTab/Window(url, ...)
alt Browser open succeeds
SearchWeb->>OS: Launch browser with URL
OS-->>SearchWeb: Success
SearchWeb-->>PublicAPIInstance: Success
else Browser open fails
SearchWeb->>OS: Try direct URL open (fallback)
alt Fallback succeeds
OS-->>SearchWeb: Success
SearchWeb-->>PublicAPIInstance: Success
else Fallback fails
OS-->>SearchWeb: Error
SearchWeb-->>PublicAPIInstance: Exception
PublicAPIInstance->>User: Show error message (browserOpenError)
end
end
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
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 (
|
@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 ...
|
Throw exception from
OpenInBrowserWindow
&OpenInBrowserTab
function inSearchWeb
and handle them inOpenUri
ofPublicAPIInstance
.Resolve #3473.