Skip to content

Ensure plugin manifest is non-nullable#4355

Merged
Jack251970 merged 3 commits intodevfrom
PluginManager_Null
Mar 15, 2026
Merged

Ensure plugin manifest is non-nullable#4355
Jack251970 merged 3 commits intodevfrom
PluginManager_Null

Conversation

@Jack251970
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 commented Mar 14, 2026

Resolve #4251


Summary by cubic

Ensures GetPluginManifest always returns a non-null list. Simplifies callers, clarifies docs/comments, and removes null checks in the plugin store view.

  • Summary of changes
    • Changed: IPublicAPI.GetPluginManifest is non-nullable and documented to return a list that may be empty. SettingsPanePluginStoreViewModel.ExternalPlugins now enumerates and sorts without null checks. Improved XML docs and inline comments for clarity.
    • Added: Empty-list fallback ([]) in PublicAPIInstance.GetPluginManifest when PluginsManifest.UserPlugins is null.
    • Removed: Prior remark suggesting GetPluginManifest could be null; null-conditional operator in ExternalPlugins.
    • Memory: Negligible. Returning an empty list instead of null adds minimal overhead.
    • Security: No new risks. Improves null-safety and contract clarity only.
    • Tests: No new unit tests. Follow-up tests can validate the empty-list contract.

Written for commit 015c32e. Summary will update on new commits.

Removed remarks from GetPluginManifest docs.
GetPluginManifest now returns an empty list if null.
ExternalPlugins property always enumerates and sorts plugins.
Added BOM to PublicAPIInstance.cs.
Copilot AI review requested due to automatic review settings March 14, 2026 12:33
@github-actions github-actions Bot added this to the 2.2.0 milestone Mar 14, 2026
@Jack251970 Jack251970 enabled auto-merge March 14, 2026 12:33
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 14, 2026

🥷 Code experts: no user but you matched threshold 10

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

See details

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Activity based on git-commit:

Jack251970 jjw24
MAR
FEB
JAN
DEC
NOV
OCT 11 additions & 2 deletions

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/PublicAPIInstance.cs

Activity based on git-commit:

Jack251970 jjw24
MAR
FEB
JAN
DEC
NOV
OCT 4 additions & 1 deletions 23 additions & 12 deletions

Knowledge based on git-blame:
Jack251970: 98%

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs

Activity based on git-commit:

Jack251970 jjw24
MAR
FEB
JAN
DEC
NOV
OCT

Knowledge based on git-blame:
Jack251970: 100%

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

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 14, 2026

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

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@coderabbitai coderabbitai Bot added the bug Something isn't working label Mar 14, 2026
Copy link
Copy Markdown
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

Updates Flow Launcher’s public API so plugin manifest access is non-nullable, preventing null-sequence LINQ crashes when the manifest fetch fails (as in #4251).

Changes:

  • Make PublicAPIInstance.GetPluginManifest() return an empty list when the manifest isn’t available (instead of null).
  • Remove the null-conditional usage in SettingsPanePluginStoreViewModel.ExternalPlugins now that the API guarantees a non-null list.
  • Remove outdated API docs indicating GetPluginManifest() may return null.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs Stops treating the manifest as nullable when building the plugin store list.
Flow.Launcher/PublicAPIInstance.cs Ensures GetPluginManifest() never returns null by coalescing to an empty list.
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs Removes outdated remark about null return (needs updated contract wording).

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

Comment thread Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28a26038-79a7-4696-b873-863f47b00df6

📥 Commits

Reviewing files that changed from the base of the PR and between 5370265 and 015c32e.

📒 Files selected for processing (1)
  • Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

📝 Walkthrough

Walkthrough

GetPluginManifest() documentation was clarified to promise a non-null IReadOnlyList. Implementation now returns an empty list when underlying manifest entries are null. A consumer callsite was updated to rely on the non-null guarantee.

Changes

Cohort / File(s) Summary
Interface documentation
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Updated XML docs for GetPluginManifest() to state it returns the current plugin manifest entries and to indicate a non-null IReadOnlyList<UserPlugin>; removed remark about possible null.
Manifest retrieval implementation
Flow.Launcher/PublicAPIInstance.cs
GetPluginManifest() now returns an empty list when PluginsManifest.UserPlugins is null, ensuring a non-null IReadOnlyList<UserPlugin> at runtime.
Manifest consumer
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
Removed null-conditional operator when calling GetPluginManifest() in the ExternalPlugins property, relying on the non-null return value and preserving the existing projection and sorting pipeline.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • VictoriousRaptor
  • jjw24
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and concisely describes the main change—ensuring the plugin manifest method is non-nullable.
Description check ✅ Passed Description directly addresses the PR objective and links to issue #4251, explaining the changes and their rationale.
Linked Issues check ✅ Passed Changes ensure GetPluginManifest returns non-null by providing empty-list fallback, addressing the root cause of ArgumentNullException crashes in LINQ operations [#4251].
Out of Scope Changes check ✅ Passed All changes directly address making GetPluginManifest non-nullable and removing null checks from consumers as required by the objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch PluginManager_Null
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

@coderabbitai coderabbitai Bot removed the bug Something isn't working label Mar 14, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs">

<violation number="1" location="Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs:539">
P3: The new return docs incorrectly say a failed manifest refresh can make this API return an empty list; in practice it keeps returning the last successful manifest. That can mislead plugin authors into using `Count == 0` as a failure signal.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@coderabbitai coderabbitai Bot added the bug Something isn't working label Mar 14, 2026
@Jack251970 Jack251970 merged commit c9dbc33 into dev Mar 15, 2026
13 checks passed
@Jack251970 Jack251970 deleted the PluginManager_Null branch March 15, 2026 15:14
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: cannot install PluginManager

3 participants