Skip to content

Implement agent auto-update functionality - #14

Merged
Undermozes merged 2 commits into
masterfrom
copilot/check-auto-update-functionality
Mar 11, 2026
Merged

Undermozes merged 2 commits into
masterfrom
copilot/check-auto-update-functionality

Conversation

Copilot AI commented Mar 11, 2026 •

Copy link
Copy Markdown

Agents had the update infrastructure in place (6-hour ETag-based checks, SignalR-triggered reinstall) but a critical bug prevented it from working correctly, and there was no per-device update trigger in the UI.

Bug fix: ETag never persisted after update detection (UpdaterWin/Linux/Mac.cs)

When a 200 OK response indicated a newer package was available, the agent installed it but never wrote the new ETag to etag.txt. On the next check cycle (or after the fresh agent started), no saved ETag meant the server returned 200 OK again → infinite reinstall loop.

// Now saved before calling InstallLatestVersion()
if (response.Headers.ETag is { } responseEtag)
{
    await File.WriteAllTextAsync("etag.txt", responseEtag.ToString());
}
await InstallLatestVersion();

New: UpdateAgents vs ReinstallAgents (CircuitConnection.cs)

ReinstallAgents sends the update command and deletes the devices from the DB — wrong for an update. Added UpdateAgents which sends ReinstallAgent via SignalR without removing device records.

New: Per-device "Update Agent" button (DeviceCard.razor)

Added an "Update Agent" entry to the DeviceCard Actions dropdown. Disabled when the device is offline. Calls UpdateAgents for the single device and shows a confirmation toast.


Please read the following. Do not delete below this line.

Thank you for your contribution to the Remotely project. It is required that contributors assign copyright to Immense Networks so we retain full ownership of the project.

This makes it easier for other entities to use the software because they only have to deal with one copyright holder. It also gives me assurance that we'll be able to make decisions in the future without gathering and consulting all contributors.

While this may seem odd, many open source maintainers practice this. Here are a couple well-known examples:

A nice article on the topic can be found here: https://haacked.com/archive/2006/01/26/WhoOwnstheCopyrightforAnOpenSourceProject.aspx/

By submitting this PR, you agree to the following:

You hereby assign copyright in this PR's code to the Remotely project and its copyright holder, Immense Networks, to be licensed under the same terms as the rest of the code. You agree to relinquish any and all copyright interest in the software, to the detriment of your heirs and successors.

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:

  • www.myget.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.2/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/Remotely/Remotely/Remotely.sln --packages /tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-308cdbf2ab4d8643/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

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


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…dateAgents method

Co-authored-by: Undermozes <58026189+Undermozes@users.noreply.github.com>
Copilot AI changed the title [WIP] Add auto update functionality for agents Implement agent auto-update functionality Mar 11, 2026
@Undermozes
Undermozes marked this pull request as ready for review March 11, 2026 22:46
@Undermozes
Undermozes merged commit 2207fb0 into master Mar 11, 2026
1 check passed
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