refactor(editor): the open sequence's jobs in their own type; restore undo as an object
WIP of the interrupted fix stage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
9 files changed
+356
-42
No files matched your search
@@ -41,6 +41,9 @@ internal sealed class FakeRemoteSequenceApi(Sequence sequence, IReadOnlyList<Gui
|
||||
|
||||
public Dictionary<Guid, JobDto> Jobs { get; } = [];
|
||||
|
||||
/// <summary>Thrown by the next read of a job (a failure the editor's event listener does not expect).</summary>
|
||||
public Exception? FailNextJobRead { get; set; }
|
||||
|
||||
/// <summary>Someone else edits the settings before each of the next edits reaches the server (it is refused with 409).</summary>
|
||||
public Queue<Func<string?, string>> EditsBefore { get; } = new();
|
||||
|
||||
@@ -116,6 +119,11 @@ internal sealed class FakeRemoteSequenceApi(Sequence sequence, IReadOnlyList<Gui
|
||||
{
|
||||
lock (_gate)
|
||||
{
|
||||
if (FailNextJobRead is { } failure)
|
||||
{
|
||||
FailNextJobRead = null;
|
||||
throw failure;
|
||||
}
|
||||
return Jobs.TryGetValue(id, out var job)
|
||||
? Task.FromResult(job)
|
||||
: throw new TitanoApiException(HttpStatusCode.NotFound, new ApiError("not_found", "job", "job"));
|
||||
|
||||
Reference in new issue
Block a user