Replay the past of a rebuilt account in its order
What an account did while the bot was off is now written before the splits and the dividends of those days, once and without acting on it; an attempt cut halfway is taken up from the same point. Until then the account is not valued at today's price, the guard keeps the last figures it knew with their time, and a stop order only cancels what is open. Protective sales of the archive are not continued, and the rest of a stop that fired in part is sold. Also the decisions of the phase (ADR 0020), the manuals and the dates under the equity chart. refs #69 #72 #75 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e58a26e8fa
commit
76b64ef147
31 files changed
+957
-130
No files matched your search
@@ -113,6 +113,28 @@ public sealed class RestoreServerTests
|
||||
}
|
||||
|
||||
Assert.IsFalse(File.Exists(file), "Trap 20: no database by itself.");
|
||||
|
||||
// The true file comes back while a choice is at work, and the choice fails: it is not taken away.
|
||||
using (await server.Host.ExclusiveAsync(CancellationToken.None))
|
||||
{
|
||||
var db = server.Host.OpenForChoice();
|
||||
File.Copy(away, file);
|
||||
Assert.IsFalse((await Migrations.StatusAsync(db, CancellationToken.None)).IsEmpty);
|
||||
await server.Host.AbandonChoiceAsync();
|
||||
Assert.IsTrue(File.Exists(file), "The file that came back stays in its place.");
|
||||
Microsoft.Data.Sqlite.SqliteConnection.ClearAllPools();
|
||||
foreach (var f in Directory.EnumerateFiles(Path.GetDirectoryName(file)!))
|
||||
{
|
||||
File.Delete(f);
|
||||
}
|
||||
|
||||
// What a choice began to write is another thing: it steps aside.
|
||||
await Migrations.MigrateAsync(server.Host.OpenForChoice(), SystemClock.Instance, null, CancellationToken.None);
|
||||
await server.Host.AbandonChoiceAsync();
|
||||
Assert.IsFalse(File.Exists(file));
|
||||
Assert.HasCount(1, Directory.GetFiles(Path.GetDirectoryName(file)!, "*.incompleto-*").Where(f => !f.EndsWith("-wal", StringComparison.Ordinal) && !f.EndsWith("-shm", StringComparison.Ordinal)).ToList());
|
||||
}
|
||||
|
||||
File.Copy(away, file);
|
||||
await server.WaitForAsync(HostMode.Ready);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user