Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

The KvExplorerDb class implemented IDisposable with an async void Dispose() method that created a new database connection just to close it—both an anti-pattern and unnecessary.

Changes

  • Removed IDisposable interface from KvExplorerDb
  • Removed async void Dispose() method
  • Removed using statement in KeyVaultTreeListViewModel constructor for the singleton DI instance

Rationale

Each method in KvExplorerDb creates and disposes its own SqliteConnection via using statements:

public async Task<bool> DeleteQuickAccessItemByKeyVaultId(string keyVaultId)
{
    using var connection = await TryCreateDatabaseAndOpenConnection();
    await connection.OpenAsync();
    // ... use connection
}

No instance-level resource management is needed. The class is registered as a singleton, making disposal at the instance level inappropriate.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Nov 15, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on V1.0.315 upgrade to dotnet 10 Remove async void Dispose() anti-pattern from KvExplorerDb Nov 15, 2025
Copilot AI requested a review from cricketthomas November 15, 2025 14:37
@cricketthomas cricketthomas deleted the copilot/sub-pr-136 branch November 16, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants