fix(app): keep Jobs › Scheduled true to the scheduler
Owner review 2, phase 2 (R10) review findings on the desktop: - Showing the Scheduled tab (and coming back to Jobs on it) reads the actions' availability again, as does a Run now answered unavailable; rows and an open editor follow, so turning proxies on no longer needs a restart. - A delete the index refuses keeps the row: the failed call no longer reads as Deleted (the enum's default), so a live schedule never leaves the page. - SchedulerReady completes false when the index (or the engine) does not open, so the tab shows that the schedules do not run instead of an empty panel. - A read of a schedule's last job that started before a live change or a later read is ignored, so a finished job no longer shows as running. - The editor's Action, Unit and Priority dropdowns follow a language change, keeping what was chosen. - Weekly days in the table read from the UI language's first day, as the editor's toggles do. - Backup tooltips no longer promise daily copies with three kept (their translations are dropped for retranslation); two tooltips now name the real Settings rows (Proxy size; Spazio su disco › Limite della cache). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit c137e2c74cddef299b2e4179ef0417fa4977953c)
This commit is contained in:
1 parent
3f0e6357b1
commit
5cb6809fd0
14 files changed
+361
-33
No files matched your search
@@ -121,6 +121,47 @@ public sealed class AppServicesTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Owner review 2, R10: when the index does not open, the schedules are known not to run at once, so Jobs › Scheduled
|
||||
/// says so instead of waiting for them with an empty tab.
|
||||
/// </summary>
|
||||
[Test]
|
||||
[WindowsOnly]
|
||||
public void AnIndexThatDoesNotOpenTellsTheScheduledTabTheSchedulesDoNotRun()
|
||||
{
|
||||
var environment = AppEnvironment.ForCapture();
|
||||
try
|
||||
{
|
||||
SingleThreadedContext.Run(async () =>
|
||||
{
|
||||
// "File is not a database", and no staged restore to recover it.
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(environment.DatabasePath)!);
|
||||
await File.WriteAllBytesAsync(environment.DatabasePath, [.. Enumerable.Repeat((byte)0x5A, 8192)]);
|
||||
var services = new AppServices(environment, new AppSettings { Language = "en" }, () => { }, new NoDialogs());
|
||||
try
|
||||
{
|
||||
await services.OpenAsync(environment.DatabasePath);
|
||||
Assert.NotNull(services.OpenError);
|
||||
var ready = services.SchedulerReady;
|
||||
Assert.Same(ready, await Task.WhenAny(ready, Task.Delay(TimeSpan.FromSeconds(TestTiming.Budget(10)))));
|
||||
Assert.False(await ready, "no schedules without an index");
|
||||
|
||||
using var schedules = new SchedulesViewModel(() => services.Scheduler, () => services.Database, _ => false, (_, _, _) => { }, _ => Task.CompletedTask);
|
||||
await schedules.AttachAsync(services.SchedulerReady);
|
||||
Assert.True(schedules.IsLoaded && schedules.IsUnavailable && !schedules.IsRunning, "the tab shows that the schedules do not run");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Assert.True(services.DisposeAsync().AsTask().Wait(TimeSpan.FromSeconds(10)), "services stopped");
|
||||
}
|
||||
});
|
||||
}
|
||||
finally
|
||||
{
|
||||
environment.DeleteCaptureData();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>BRIEF §6.2: a restore staged in Settings › Advanced recovers an index that no longer opens.</summary>
|
||||
[Test]
|
||||
[WindowsOnly]
|
||||
|
||||
Reference in new issue
Block a user