fix(plugins): quarantine stuck plugins without deleting them#2160
fix(plugins): quarantine stuck plugins without deleting them#2160bajrangCoder wants to merge 6 commits into
Conversation
Greptile SummaryThis PR replaces the delete-on-failure plugin loader with a two-tier quarantine system: plugins that exceed 15 s during startup continue loading in the background, and are only persisted as disabled (without deleting files) if they are still unresolved after 60 s total. Genuine load errors are immediately marked broken and written to
Confidence Score: 5/5Safe to merge — plugin files are preserved on failure, the quarantine logic is well-serialized, and the theme-plugin retry loop is now correctly gated on the persisted disabled map. All three issues raised in earlier review rounds (string-match ambiguity, settings write ordering, and theme plugins retried on restart) are addressed in this revision. The only remaining finding is a no-op settings write in No files require special attention; Important Files Changed
Sequence DiagramsequenceDiagram
participant App as App Startup
participant LPT as loadPluginWithTimeout
participant LP as loadPlugin (background)
participant Settings as settings (pluginsDisabled)
App->>LPT: loadPluginWithTimeout(pluginId)
LPT->>LP: loadPlugin(pluginId) [background]
Note over LPT: 15 s timeout races loadPlugin
alt Plugin loads within 15 s
LP-->>LPT: resolved
LPT->>Settings: markPluginLoaded (clear disabled if set)
LPT-->>App: return true
else Plugin times out at 15 s
LPT->>LPT: markPluginTimedOut (BROKEN_PLUGINS in-memory)
LPT-->>App: return false (startup continues)
Note over LP: still running in background
alt Plugin loads before 60 s
LP-->>LPT: resolved
LPT->>Settings: markPluginLoaded / updatePluginDisabled(false)
else Plugin still stuck at 60 s
LPT->>Settings: markPluginBroken / updatePluginDisabled(true)
end
else Plugin throws real error
LP-->>LPT: rejected
LPT->>Settings: markPluginBroken / updatePluginDisabled(true)
LPT-->>App: throw error
end
Reviews (5): Last reviewed commit: "fix" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
|
Preview Release for this, has been built. |
Summary
Fixes plugin disappearance caused by startup load failures/timeouts deleting installed plugin folders.
New Behavior
pluginsDisabled.Why
Previously, the startup plugin loader treated slow plugins and broken plugins the same. Any failed/timed-out plugin was added to
failedPlugins, thencleanupFailedPlugins()deleted its directory fromPLUGIN_DIR.That could make plugins appear to disappear permanently, especially on slower devices where valid plugins may exceed the startup timeout.
Fixes: #2010