Skip to content

v0.2.3

Choose a tag to compare

@joshuapare joshuapare released this 10 Mar 04:29
· 325 commits to main since this release
c16bc27

v0.2.3 — Plugin Concurrency Hardening, Networker Logging & Lint Modernization

Concurrency & Race Condition Fixes

Plugin Loader

  • Serialized concurrent plugin reloads to prevent double lifecycle calls (start/stop racing on the same plugin)
  • Added test coverage for concurrent reload serialization

Exec Controller

  • Fixed runMux using sessionID as channel map key instead of resolving pluginID via sessionIndex
  • Eliminated send-on-closed-channel races: safeSend helper with named return and recover guard propagates errors to callers (e.g. WriteSession)
  • Consolidated double-RLock pattern across 5 session methods into single lookupSession helper
  • OnPluginStop and OnPluginShutdown now fully clean up inChans, sessionIndex, and handlerMap entries
  • OnPluginStart defers state registration until provider.Stream succeeds, preventing leaked channels on stream failure
  • Removed unused stops map field
  • GetPluginHandlers / GetHandlers return defensive map copies

Logs Controller

  • OnPluginStop and OnPluginShutdown now clean up handlerMap entries to prevent stale resource handlers
  • SendCommand holds mutex during channel send to prevent send-on-closed-channel panic
  • Added concurrency test for send-during-shutdown race

Metric Controller

  • Unsubscribe sends to channel while holding lock to prevent race with removePlugin

Settings Controller

  • Added mutex protection to all plugin controller map accesses

Resource Controller

  • CheckConnection now wraps errors through toAppError and checkConnectionError, consistent with other Wails-bound RPCs
  • Added crash-recovery test coverage

Plugin Manager

  • HandlePluginCrash sanitizes log messages (redacts tokens, long base64/hex strings) before storing in crash context

Networker & CheckConnection

  • Added CheckConnection RPC support to the networker controller (Wails bindings + adapter)
  • Added debug-level logging to port-forward lifecycle methods (StartPortForwardSession, ClosePortForwardSession, StopAll)

UI Fixes

  • ConnectionTableItem: Fixed isConnected() — replaced unreliable toString() === 'Invalid Date' with isNaN(getTime())
  • HomepageCard: Wrapped PluginContext.Provider value in useMemo to prevent unnecessary re-renders
  • ResourceTableView: Moved groups.isError check above !groups.data early return so errors render instead of an empty fragment

Tooling & Config

  • Migrated both .golangci.yml configs to golangci-lint v2 format (version: "2", linters.default: none, formatters section)
  • Enabled exhaustruct and gomodguard linters (settings existed but linters weren't in enable list)
  • Added goimports local-prefixes setting to match gci prefix
  • Removed dead wrapcheck test exclusion (linter not enabled)
  • Deleted plugins/aws/.golangci.yml (plugin moving to its own repo)

Dependencies

  • Bumped plugin-sdk to v0.2.1

SDK v0.2.1 Changes (included via dependency bump)

  • context.TODO() → context.Background() in networker/exec shutdown paths
  • Added logging to ClosePortForwardSession and StopAll
  • Resource controller: added logger field, replaced silent _ = error swallowing with Warnw logging
  • Fixed TOCTOU race in watch_manager.go AddListener/OnStateChange (lock ordering: listenersMu → pendingMu)
  • Added injectSession to StartConnection and StopConnection RPCs for consistency

What's Changed

  • fix: plugin concurrency, networker logging, and SDK v0.2.1 by @joshuapare in #23

Full Changelog: v0.2.2...v0.2.3