Write the manuals and fix what following them found
The manual, the runbook and the go-live list are written and checked claim by claim against the code, and the installation is done from zero by following them on both engines. That found real defects, now fixed: - with SQLite a missing database file left no way to restore a backup: the choices appear, and the file is created only by the user's choice; - an account whose difference vanished after the 15 minutes stayed prudent with no button, a missing stop could be left out for good, and a choice made while the broker was silent used old numbers; - after "Ferma tutto" the positions could not be closed without restarting; - a refused key looked like a silent broker: it has its own notice now; - the split of the capital between the strategies of a broker (SPEC 13.5) could not be changed from the interface. refs #72 #68 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2257c3e16c
commit
24e20584d4
28 files changed
+1147
-57
No files matched your search
@@ -128,6 +128,16 @@ internal sealed partial class AnubisHost(
|
||||
/// <summary>The database even when not ready (error-page choices need it to restore or import).</summary>
|
||||
internal Database? Database => _db;
|
||||
|
||||
/// <summary>SQLite, and the file of an installation that exists is not in its place.</summary>
|
||||
internal bool SqliteFileMissing =>
|
||||
Config.Db is { Engine: DbEngine.Sqlite, SqlitePath: { } path } && !File.Exists(path) && File.Exists(Config.Data.InstallationFile);
|
||||
|
||||
/// <summary>
|
||||
/// For an error-page choice that writes into a missing SQLite file: the only place where a known installation gets a
|
||||
/// new one. Called while the choice holds <see cref="ExclusiveAsync"/>.
|
||||
/// </summary>
|
||||
internal Database OpenForChoice() => _db ??= Database.Open(Config.Db!, allowCreate: SqliteFileMissing);
|
||||
|
||||
/// <summary>Holds the loop still while an error-page choice works on the database.</summary>
|
||||
internal async Task<IDisposable> ExclusiveAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -250,7 +260,6 @@ internal sealed partial class AnubisHost(
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
SetStatus(HostMode.DatabaseUnavailable, Redactor.Redact(ex.Message));
|
||||
if (Config.Db!.Engine == DbEngine.Sqlite)
|
||||
{
|
||||
// Reopen next time: the file may come back, or the folder may be released.
|
||||
@@ -258,6 +267,15 @@ internal sealed partial class AnubisHost(
|
||||
_db = null;
|
||||
}
|
||||
|
||||
if (SqliteFileMissing)
|
||||
{
|
||||
// SPEC 15.1: without the file the user may restore, import or start over, as with an empty database. The
|
||||
// file is created only by that choice, and a file that comes back meanwhile is used without one.
|
||||
SetStatus(HostMode.IdentityProblem, Redactor.Redact(ex.Message), new IdentityCheck(IdentityVerdict.EmptyDatabase, Installation.ReadFile(Config.Data), null));
|
||||
return;
|
||||
}
|
||||
|
||||
SetStatus(HostMode.DatabaseUnavailable, Redactor.Redact(ex.Message));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user