Class PluginUpdateCheckService

Namespace
Kuestenlogik.Bowire.Plugins
Assembly
Kuestenlogik.Bowire.dll

Reusable "check installed plugin versions against nuget.org" pipeline shared between the daily background check (PluginUpdateCheckHostedService) and the manual GET /api/plugins/check-updates endpoint.

public class PluginUpdateCheckService
Inheritance
PluginUpdateCheckService
Inherited Members

Remarks

Hits the NuGet v3-flatcontainer registration index for each installed sibling plugin (bundled plugins are skipped — they move with dotnet tool update, not as standalone packages). Result snapshot is cached on disk under ~/.bowire/state/update-check.json so the UI can render the last-known state without re-hitting nuget.org on every page load.

Constructors

PluginUpdateCheckService(HttpClient?)

public PluginUpdateCheckService(HttpClient? http = null)

Parameters

http HttpClient

Methods

CheckAsync(bool, CancellationToken)

Run a live check against nuget.org for every installed sibling plugin. Result is persisted to Kuestenlogik.Bowire.Plugins.PluginUpdateCheckService.CachePath on success so the next status read returns immediately.

public virtual Task<PluginUpdateCheckSnapshot> CheckAsync(bool includePrerelease, CancellationToken ct)

Parameters

includePrerelease bool
ct CancellationToken

Returns

Task<PluginUpdateCheckSnapshot>

Remarks

Virtual so tests can derive + override to drive the PluginUpdateCheckHostedService's exception-handling path without spinning a fake HTTP stack that throws mid-response.

ReadCached()

Read the last persisted snapshot without hitting the network. Returns null when no check has run yet (cache file absent or unreadable).

public static PluginUpdateCheckSnapshot? ReadCached()

Returns

PluginUpdateCheckSnapshot