fix(app): keep the editor's own save errors and gate an unread archive
- Editor: a failed save showed what the server or the archive layer would say
for the exception's type, so the editor's own sentences were lost: frames
changed on the server or settings changed elsewhere read "The server does not
answer", a read-only account or a gone sequence "Something went wrong". These
failures are now EditorException (an IOException; ProxiesOutdatedException
derives from it) and the toast shows their sentence as it is. A project
written by a newer Titano is reported with the same sentence as a corrupt one
instead of the parser's English text.
- Library: a job posted to a server whose certificate changed since sign-in
threw out of the action unreported; the pin's refusal now reaches the error
toast ("The certificate was not trusted").
- Archive: picking another archive forced it offline until it was read, so the
rebuild dialog called it offline with the previous archive's count, and
disabled commands said the archive must be online. What was read is now kept
apart from availability: until the picked archive is read, Rebuild and the
online commands wait and say so, health fixes and search results of the
previous archive are cleared, and a running search is cancelled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
15 files changed
+218
-31
No files matched your search
@@ -5,6 +5,7 @@ using Titano.Core.Codecs.Jpeg;
|
||||
using Titano.Core.Diagnostics.Synthetic;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Imaging.Decoders;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Processing;
|
||||
@@ -229,7 +230,8 @@ public sealed class RemoteSequenceSourceTests(TestContext context)
|
||||
return (theirs with { Camera = theirs.Camera with { OffsetX = offset } }).ToJson();
|
||||
});
|
||||
}
|
||||
await Assert.ThrowsAsync<IOException>(() => source.SaveProjectAsync(content.Project with { HeroFrame = 2 }, content.Project, context.Cancellation));
|
||||
var conflict = await Assert.ThrowsAsync<EditorException>(() => source.SaveProjectAsync(content.Project with { HeroFrame = 2 }, content.Project, context.Cancellation));
|
||||
Assert.Equal(Loc.L("Editor.Error.SaveConflict"), conflict.Message, "the toast shows the editor's own sentence");
|
||||
Assert.False(api.Edits.Any(e => e.Accepted));
|
||||
}
|
||||
}
|
||||
@@ -268,8 +270,9 @@ public sealed class RemoteSequenceSourceTests(TestContext context)
|
||||
}
|
||||
|
||||
// The source refuses a change as well; the same project is no change.
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() =>
|
||||
var refused = await Assert.ThrowsAsync<EditorException>(() =>
|
||||
source.SaveProjectAsync(content.Project with { HeroFrame = 1 }, content.Project, context.Cancellation));
|
||||
Assert.Equal(Loc.L("Editor.Error.RemoteReadOnly"), refused.Message);
|
||||
Assert.True(ProjectMerge.SameValues(content.Project, await source.SaveProjectAsync(content.Project, content.Project, context.Cancellation)));
|
||||
Assert.Empty(api.Edits);
|
||||
}
|
||||
@@ -366,8 +369,9 @@ public sealed class RemoteSequenceSourceTests(TestContext context)
|
||||
{
|
||||
var content = await source.LoadAsync(context.Cancellation);
|
||||
api.Gone = true;
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => source.LoadAsync(context.Cancellation));
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => source.SaveProjectAsync(content.Project with { HeroFrame = 1 }, content.Project, context.Cancellation));
|
||||
Assert.Equal(Loc.L("Editor.Error.Missing"), (await Assert.ThrowsAsync<EditorException>(() => source.LoadAsync(context.Cancellation))).Message);
|
||||
var gone = await Assert.ThrowsAsync<EditorException>(() => source.SaveProjectAsync(content.Project with { HeroFrame = 1 }, content.Project, context.Cancellation));
|
||||
Assert.Equal(Loc.L("Editor.Error.Missing"), gone.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user