Public Access
Updates: offer an RPM only to a copy rpm owns, and never read an unknown version as older
On a distribution without rpm, a locally built package that mirrors the spec puts the nightly tree at /opt/DodoSSH.Nightly, and that path was the whole test for "the RPM installed this". The channel then asked rpm for the installed version, got nothing because there is no rpm, read the silence as "0", and offered every nightly as newer, fetching a 56 MB RPM into the profile directory that the machine could never install, every six hours. UpdateChannels.LinuxChannel still checks the path first, then asks rpm through the new LinuxUpdateChannel.ForInstall. A copy rpm has no record of gets an UnavailableUpdateChannel that says it was installed outside the dodossh-nightly (or dodossh) RPM and should be updated with the package manager that installed it. UnavailableUpdateChannel gains an optional Reason for that, UpdateViewModel exposes it as UnsupportedReason, and the desktop preferences page shows it in place of the sentence about checkouts and unzipped copies. That costs one rpm launch at start, and only where the path already matched. CheckAsync no longer falls back to "0". If rpm stops answering after composition, the check throws instead, so CHECK NOW reports it and the timer stays quiet, and nothing is offered or fetched. The comment that called the fallback a deliberate choice is replaced with the reason it was wrong. LinuxUpdateChannelTests: an unknown installed version throws and downloads nothing (replacing the test that asserted the old behaviour), a copy rpm does not own is unavailable and says why, and a copy rpm owns gets the channel. The newer, equal and older comparisons were already covered. UpdateFlowTests covers the reason reaching the view model. Manual check 19.13. App tests 744/752 with 8 skips, layout tests 202/203 with 1 skip; the full solution passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f7354aa7e8
commit
e0509c6679
8 files changed
+238
-29
No files matched your search
@@ -80,6 +80,32 @@ public sealed class UpdateFlowTests : IDisposable
|
||||
Build().CurrentVersion.ShouldBe("0.4.2");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ABuildThatCannotReplaceItself_ForAReasonOfItsOwn_SaysThatInstead()
|
||||
{
|
||||
var updates = new UpdateViewModel(
|
||||
new UnavailableUpdateChannel("Update it with the package manager that installed it."),
|
||||
new ClientSettingsStore(Paths),
|
||||
TimeProvider.System,
|
||||
() => 0,
|
||||
restart: _ => Task.CompletedTask);
|
||||
|
||||
updates.IsUnsupported.ShouldBeTrue();
|
||||
updates.UnsupportedReason.ShouldBe("Update it with the package manager that installed it.");
|
||||
updates.IsUnsupportedForTheUsualReason.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ABuildThatCannotReplaceItself_ForTheUsualReasons_LeavesTheScreenItsOwnSentence()
|
||||
{
|
||||
channel.IsSupported = false;
|
||||
|
||||
var updates = Build();
|
||||
|
||||
updates.UnsupportedReason.ShouldBeNull();
|
||||
updates.IsUnsupportedForTheUsualReason.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ABackgroundPassThatFindsNothing_SaysNothing()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user