Skip to content

Conversation

@Jack251970
Copy link
Member

Updated the ErrorReporting class to log recoverable DWM composition exceptions instead of displaying the "Report problem UI," addressing issues with crashes in
PresentationFramework.dll. Introduced a new ExceptionHelper class to encapsulate logic for identifying recoverable DWM composition exceptions based on specific HRESULT values and stack trace patterns. Added detailed comments for context and referenced a related GitHub issue. Improved modularity and maintainability by isolating exception handling logic in the ExceptionHelper class.

From: microsoft/PowerToys#42588.
Resolve: #4016

Updated the `ErrorReporting` class to log recoverable DWM
composition exceptions instead of displaying the "Report
problem UI," addressing issues with crashes in
`PresentationFramework.dll`. Introduced a new `ExceptionHelper`
class to encapsulate logic for identifying recoverable DWM
composition exceptions based on specific HRESULT values and
stack trace patterns. Added detailed comments for context and
referenced a related GitHub issue. Improved modularity and
maintainability by isolating exception handling logic in the
`ExceptionHelper` class.
@github-actions github-actions bot added this to the 2.1.0 milestone Nov 16, 2025
@Jack251970 Jack251970 requested a review from Copilot November 16, 2025 03:40
@Jack251970 Jack251970 added the bug Something isn't working label Nov 16, 2025
@gitstream-cm
Copy link

gitstream-cm bot commented Nov 16, 2025

🥷 Code experts: Yusyuriv

Jack251970 has most 👩‍💻 activity in the files.
Yusyuriv, Jack251970 have most 🧠 knowledge in the files.

See details

Flow.Launcher/Helper/ErrorReporting.cs

Activity based on git-commit:

Jack251970
NOV
OCT
SEP
AUG
JUL
JUN 7 additions & 5 deletions

Knowledge based on git-blame:
Yusyuriv: 57%
Jack251970: 29%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link

gitstream-cm bot commented Nov 16, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@Jack251970 Jack251970 enabled auto-merge November 16, 2025 03:42
Copilot finished reviewing on behalf of Jack251970 November 16, 2025 03:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds detection for recoverable DWM (Desktop Window Manager) COMExceptions and skips showing the ReportWindow for those cases by introducing an internal helper and using it in ErrorReporting to return early for identified recoverable DWM exceptions.

Changes

Cohort / File(s) Change Summary
DWM composition detection helper
Flow.Launcher/Helper/ExceptionHelper.cs
New internal static class ExceptionHelper with internal static bool IsRecoverableDwmCompositionException(Exception) that checks for COMException HRESULTs (DWM_E_COMPOSITIONDISABLED, STATUS_MESSAGE_LOST_HR), a specific Source string, and a stack-trace substring DwmCompositionChanged.
Error reporting conditional skip
Flow.Launcher/Helper/ErrorReporting.cs
After logging a fatal exception, calls ExceptionHelper.IsRecoverableDwmCompositionException(e) and returns early (skips creating/showing ReportWindow) when it returns true; includes explanatory comments.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant ErrorReporting
    participant ExceptionHelper
    participant ReportWindow

    App->>ErrorReporting: Exception thrown
    Note over ErrorReporting: Log fatal exception
    ErrorReporting->>ExceptionHelper: IsRecoverableDwmCompositionException(e)?
    alt Recoverable DWM exception (true)
        ExceptionHelper-->>ErrorReporting: true
        Note over ErrorReporting: Return early — skip ReportWindow
    else Non-recoverable (false)
        ExceptionHelper-->>ErrorReporting: false
        ErrorReporting->>ReportWindow: Create & show report UI
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Areas to check:
    • Correctness of HRESULT constant values and the Source string.
    • Robustness and case-sensitivity of the stack-trace substring check.
    • Appropriate internal visibility and any necessary unit tests for the new helper.

Suggested reviewers

  • taooceros
  • VictoriousRaptor

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: handling recoverable DWM composition exceptions gracefully instead of showing crash UI.
Description check ✅ Passed The description clearly explains the changes made, references the linked issue #4016, and provides context about the implementation approach and modularity improvements.
Linked Issues check ✅ Passed The code changes directly address issue #4016 by detecting recoverable DWM composition exceptions and logging them instead of crashing, preventing the system freeze and black screen reported.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the DWM composition exception handling issue, with no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve_dwm

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80a67ba and d148f61.

📒 Files selected for processing (1)
  • Flow.Launcher/Helper/ExceptionHelper.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.
📚 Learning: 2025-07-06T12:21:37.947Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
📚 Learning: 2025-07-21T09:19:49.684Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
📚 Learning: 2025-07-21T09:19:19.012Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
📚 Learning: 2025-08-13T06:12:43.382Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3897
File: Flow.Launcher/ViewModel/PluginViewModel.cs:46-51
Timestamp: 2025-08-13T06:12:43.382Z
Learning: In Flow Launcher's PluginViewModel.cs, the LoadIconAsync method does not require additional try-catch error handling according to maintainer Jack251970, as the existing error handling approach is considered sufficient for the image loading operations.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
📚 Learning: 2025-09-06T05:32:51.575Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3573
File: Plugins/Flow.Launcher.Plugin.Shell/Main.cs:330-339
Timestamp: 2025-09-06T05:32:51.575Z
Learning: In Flow.Launcher Shell plugin's StartProcess method, the maintainer Jack251970 prefers not to propagate launch failures from Context.API.StartProcess or throw exceptions when the API call returns false. Silent failure handling is intentional for shell commands in this plugin.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
📚 Learning: 2025-07-20T07:28:28.092Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3850
File: Flow.Launcher.Core/Resource/Internationalization.cs:0-0
Timestamp: 2025-07-20T07:28:28.092Z
Learning: In Flow Launcher's Internationalization class, when the Flow Launcher language directory or default language file is missing, the only viable approach is to log an error and return early - there are no fallback mechanisms or alternative recovery strategies available due to architectural constraints.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
🪛 GitHub Check: Check Spelling
Flow.Launcher/Helper/ExceptionHelper.cs

[warning] 40-40:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 20-20:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 40-40:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 20-20:
Dwm is not a recognized word. (unrecognized-spelling)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (1)
Flow.Launcher/Helper/ExceptionHelper.cs (1)

20-41: LGTM! Solid implementation that directly addresses issue #4016.

The detection logic correctly identifies the specific COMException (0x80263001) reported in issue #4016, along with additional recoverable DWM composition scenarios. The stack trace pattern matching for "DwmCompositionChanged" aligns with the reported stack trace, and the case-insensitive comparison is already implemented.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
Flow.Launcher/Helper/ErrorReporting.cs (1)

20-25: DWM guard behavior looks right; consider simplifying the helper call.

The new guard correctly keeps logging while suppressing the report UI for recoverable DWM composition COMExceptions, which aligns with the PR goal. One small readability tweak:

  • ExceptionHelper.IsRecoverableDwmCompositionException already handles non‑COM exceptions internally via pattern matching, so the explicit as COMException cast is redundant and slightly narrows future flexibility (e.g., if you later want to inspect wrapper exceptions inside the helper).

You could simplify to:

-        if (ExceptionHelper.IsRecoverableDwmCompositionException(e as System.Runtime.InteropServices.COMException)) return;
+        if (ExceptionHelper.IsRecoverableDwmCompositionException(e))
+        {
+            return;
+        }

This preserves behavior today and keeps the helper usage straightforward.

Flow.Launcher/Helper/ExceptionHelper.cs (1)

1-44: Helper logic matches the described DWM COMException patterns; consider tests and possible inner‑exception handling.

The detection logic for recoverable DWM composition exceptions looks solid: you constrain on COMException, check the two specific HRESULTs, gate one on Source == "PresentationFramework", and fall back to the DwmCompositionChanged stack‑trace pattern. That matches the linked issue and the intent to avoid raising the report UI for these crashes.

Two small, non‑blocking improvements you might want to consider:

  1. Unit tests for the helper branches

    Creating targeted tests for:

    • DWM_E_COMPOSITIONDISABLED
    • STATUS_MESSAGE_LOST_HR + PresentationFramework source
    • Stack‑trace pattern only
    • Non‑matching COMException and non‑COM exceptions

    would help prevent regressions if more patterns or HRESULTs are added later.

  2. Future‑proofing for wrapped exceptions (optional)

    Right now, only top‑level COMExceptions are treated as recoverable. If WPF or other infrastructure ever starts wrapping these in another exception type (e.g., XamlParseException with an inner COMException), you may want to extend this helper to optionally walk InnerException/AggregateException trees. Not necessary for the current bug, but something to keep in mind.

Overall, the implementation is clear and localized, which should make future tuning straightforward.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6c4132 and b44e525.

📒 Files selected for processing (2)
  • Flow.Launcher/Helper/ErrorReporting.cs (1 hunks)
  • Flow.Launcher/Helper/ExceptionHelper.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/Helper/PluginInstallationHelper.cs:251-252
Timestamp: 2025-06-29T08:31:07.816Z
Learning: In Flow Launcher's PluginInstallationHelper, when the progress box encounters an exception during download (indicated by reportProgress becoming null), the retry logic intentionally downloads without a progress handler to avoid repeating the same progress reporting failure. This prevents cascading exceptions in the progress reporting mechanism.
📚 Learning: 2025-07-06T12:21:37.947Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Flow.Launcher/Helper/ExceptionHelper.cs
  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-06-29T08:31:07.816Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/Helper/PluginInstallationHelper.cs:251-252
Timestamp: 2025-06-29T08:31:07.816Z
Learning: In Flow Launcher's PluginInstallationHelper, when the progress box encounters an exception during download (indicated by reportProgress becoming null), the retry logic intentionally downloads without a progress handler to avoid repeating the same progress reporting failure. This prevents cascading exceptions in the progress reporting mechanism.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-06-08T14:12:21.348Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
🧬 Code graph analysis (1)
Flow.Launcher/Helper/ErrorReporting.cs (1)
Flow.Launcher/Helper/ExceptionHelper.cs (2)
  • ExceptionHelper (10-44)
  • IsRecoverableDwmCompositionException (22-43)
🪛 GitHub Check: Check Spelling
Flow.Launcher/Helper/ExceptionHelper.cs

[warning] 42-42:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 22-22:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 42-42:
Dwm is not a recognized word. (unrecognized-spelling)


[warning] 22-22:
Dwm is not a recognized word. (unrecognized-spelling)

Flow.Launcher/Helper/ErrorReporting.cs

[warning] 25-25:
Dwm is not a recognized word. (unrecognized-spelling)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: CodeQL analysis (csharp)
  • GitHub Check: Agent
  • GitHub Check: gitStream.cm
  • GitHub Check: build

Copy link
Contributor

Copilot AI left a 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 improves error handling for WPF DWM composition exceptions by introducing graceful recovery instead of displaying error UI. The changes isolate exception detection logic in a new ExceptionHelper class and update ErrorReporting to silently log recoverable DWM composition exceptions.

  • Introduced ExceptionHelper class with logic to identify recoverable DWM composition exceptions based on HRESULT values (0x80263001, 0xD0000701) and stack trace patterns
  • Modified ErrorReporting.Report() to check for recoverable DWM exceptions before displaying error UI
  • Added detailed comments explaining the issue context and linking to the WPF source code where these exceptions originate

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Flow.Launcher/Helper/ExceptionHelper.cs New class providing static method to identify recoverable DWM composition COMExceptions by checking HRESULT codes and stack traces
Flow.Launcher/Helper/ErrorReporting.cs Updated to check for recoverable DWM exceptions and silently log them instead of showing error dialog, preventing UI hangs during WPF composition changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jjw24 jjw24 added review in progress Indicates that a review is in progress for this PR and removed 5 min review labels Nov 17, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f83c10 and 80a67ba.

📒 Files selected for processing (1)
  • Flow.Launcher/Helper/ErrorReporting.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.
📚 Learning: 2025-07-06T12:21:37.947Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-06-29T08:31:07.816Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3572
File: Flow.Launcher/Helper/PluginInstallationHelper.cs:251-252
Timestamp: 2025-06-29T08:31:07.816Z
Learning: In Flow Launcher's PluginInstallationHelper, when the progress box encounters an exception during download (indicated by reportProgress becoming null), the retry logic intentionally downloads without a progress handler to avoid repeating the same progress reporting failure. This prevents cascading exceptions in the progress reporting mechanism.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-06-08T14:12:21.348Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-07-21T09:19:49.684Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-09-05T11:56:27.267Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3593
File: Flow.Launcher/HotkeyControlDialog.xaml:6-6
Timestamp: 2025-09-05T11:56:27.267Z
Learning: In Flow.Launcher's migration to iNKORE.UI.WPF.Modern UI framework, dialog resource keys like PopuBGColor, PopupButtonAreaBGColor, PopupButtonAreaBorderColor, and PopupTextColor are provided by the iNKORE.UI.WPF.Modern framework itself, not defined locally in the codebase theme files.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-09-28T03:59:59.693Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3770
File: Plugins/Flow.Launcher.Plugin.Explorer/Views/RenameFile.xaml.cs:75-80
Timestamp: 2025-09-28T03:59:59.693Z
Learning: In Flow.Launcher's Explorer plugin rename dialog (RenameFile.xaml.cs), the dialog should close unconditionally after calling RenameThing.Rename(), even on validation failures, because RenameThing.Rename() displays error messages via popup notifications. This is the intended UX design.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2025-08-13T06:12:43.382Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3897
File: Flow.Launcher/ViewModel/PluginViewModel.cs:46-51
Timestamp: 2025-08-13T06:12:43.382Z
Learning: In Flow Launcher's PluginViewModel.cs, the LoadIconAsync method does not require additional try-catch error handling according to maintainer Jack251970, as the existing error handling approach is considered sufficient for the image loading operations.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
📚 Learning: 2024-11-03T07:40:11.014Z
Learnt from: Yusyuriv
Repo: Flow-Launcher/Flow.Launcher PR: 3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.

Applied to files:

  • Flow.Launcher/Helper/ErrorReporting.cs
🧬 Code graph analysis (1)
Flow.Launcher/Helper/ErrorReporting.cs (1)
Flow.Launcher/Helper/ExceptionHelper.cs (2)
  • ExceptionHelper (10-44)
  • IsRecoverableDwmCompositionException (22-43)
🪛 GitHub Check: Check Spelling
Flow.Launcher/Helper/ErrorReporting.cs

[warning] 26-26:
Dwm is not a recognized word. (unrecognized-spelling)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (1)
Flow.Launcher/Helper/ErrorReporting.cs (1)

26-26: LGTM! Clean approach to handling recoverable DWM composition exceptions.

The implementation correctly:

  • Logs the exception first (line 17) to ensure all errors are captured for diagnostics
  • Detects recoverable DWM composition exceptions using the helper
  • Skips the error report UI for these transient issues, preventing the reported UI hangs

This addresses issue #4016 effectively while maintaining proper error logging.

@jjw24 jjw24 disabled auto-merge November 19, 2025 19:58
@jjw24 jjw24 enabled auto-merge (squash) November 19, 2025 19:58
@jjw24 jjw24 removed review in progress Indicates that a review is in progress for this PR 5 min review labels Nov 19, 2025
@jjw24 jjw24 merged commit a773b51 into dev Nov 19, 2025
6 checks passed
@jjw24 jjw24 deleted the improve_dwm branch November 19, 2025 20:16
@jjw24 jjw24 modified the milestones: 2.1.0, 2.0.3 Nov 20, 2025
@jjw24 jjw24 mentioned this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: COMException- Desktop composition is disabled

3 participants