Skip to content

plugins: retry a failed load with a fresh component - #4076

Merged
bbedward merged 2 commits into
duxlabs-dev:masterfrom
bernardopg:plugins/retry-failed-load
Nov 2, 2026
Merged

bbedward merged 2 commits into
duxlabs-dev:masterfrom
bernardopg:plugins/retry-failed-load

Conversation

@bernardopg

Copy link
Copy Markdown
Contributor

Description

When a plugin component or its startupCheck fails to compile, bump the plugin's component revision. Qt caches the compiled component per URL, failures included, so before this every later attempt at the same ?revision=N got the old error back, even after the files were fixed. Now fixing the plugin and switching it back on loads it.

It only does something when a load fails. Nothing changes for working plugins or at idle.

The test mock for Qt.createComponent now caches failures per URL like Qt does, and the new test covers both a broken widget and a broken startupCheck. It fails on master, and removing either of the two added lines fails the matching case.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Fixes #4074

Screenshots / video

Plugin with a broken widget, file fixed, then toggled on again.

Before: the toggle stays off with the error that's no longer in the file.

before

After: it loads.

after

Tested on a live session: v2.0.0 with this patch, run through DMS_SHELL_DIR on Hyprland. Without the patch, plugins enable after the fix returns PLUGIN_ENABLE_FAILED. With it, PLUGIN_ENABLE_SUCCESS.

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible (no new strings)
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean (no Go changes)
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dux-docs to document any new behaviors (no new behavior to document)

python3 quickshell/tests/run-qml.py passes (logic, qt, lock), and so do the prek hooks on the changed files.

A good part of this change was written with an AI assistant, and it helped write this description. I reviewed and tested all of it and can explain every line.

@github-actions github-actions Bot added fix ui Quickshell UI under quickshell/ labels Nov 2, 2026
@bbedward

bbedward commented Nov 2, 2026

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: revision bump on surface and startupCheck compile failures in PluginService.qml, the readers of pluginComponentUrl (settings page, DesktopWidgetRegistry), idle and retained-memory impact (only runs on failure), and the updated createComponent mock and new test in plugin-reload.test.mjs. Model: claude-opus-5-5.

…d-load

# Conflicts:
#	quickshell/Services/PluginService.qml
#	quickshell/tests/plugin-reload.test.mjs
@bbedward
bbedward merged commit 1507334 into duxlabs-dev:master Nov 2, 2026
3 checks passed
purian23 pushed a commit that referenced this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix ui Quickshell UI under quickshell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabling a plugin again after a failed load keeps showing the old error

2 participants