fix(workspace): follow server renames, never keep a thumbnail as a proxy on resume
A pull and the server's renamed event write the home's name into the copy, so a rename made on the server reaches the workspace. A copy from a server marks a thumbnail taken for a missing proxy before moving it into place; a resumed run reads the marker and fetches the proxy the server has now, instead of recording the thumbnail as one. Tests also cover the frames stamp (frames read only when it moves), an older server's copy refusal and a viewer's 403 push. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
44f0d30147
commit
cdd29f8e84
4 files changed
+227
-7
No files matched your search
@@ -249,17 +249,38 @@ public sealed class WorkspaceHost
|
||||
return;
|
||||
}
|
||||
// The folder is named by the project's id: only a project this workspace holds, of that server and sequence, is told.
|
||||
BundleHome home;
|
||||
try
|
||||
{
|
||||
if (!IsAvailable || Store.Find(change.ProjectId)?.ReadBundle().Workspace?.Home is not { IsArchive: false } home || home.SequenceId != change.SequenceId
|
||||
|| !string.Equals(home.Server, server, StringComparison.OrdinalIgnoreCase))
|
||||
if (!IsAvailable || Store.Find(change.ProjectId)?.ReadBundle().Workspace?.Home is not { IsArchive: false } held || held.SequenceId != change.SequenceId
|
||||
|| !string.Equals(held.Server, server, StringComparison.OrdinalIgnoreCase))
|
||||
return;
|
||||
home = held;
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or InvalidDataException or UnauthorizedAccessException)
|
||||
{
|
||||
Log.Info("workspace", $"A change of project {change.ProjectId} on {server} could not be matched: {ex.Message}");
|
||||
return;
|
||||
}
|
||||
if (change.Change != ProjectChanges.Renamed)
|
||||
{
|
||||
HomeChanged?.Invoke(new WorkspaceHomeChange(server, change.ProjectId, change.Change));
|
||||
return;
|
||||
}
|
||||
// A rename at the server is written to the copy here before it is told, so the state read again shows the new name.
|
||||
_ = FollowNameThenTellAsync(server, home, change);
|
||||
}
|
||||
|
||||
private async Task FollowNameThenTellAsync(string server, BundleHome home, ProjectChangedEvent change)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (HomeOf(home) is { } reached) await Sync.FollowNameAsync(change.ProjectId, reached).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex) when (ex is not OutOfMemoryException)
|
||||
{
|
||||
Log.Info("workspace", $"The new name of project {change.ProjectId} on {server} could not be followed: {ex.Message}");
|
||||
}
|
||||
HomeChanged?.Invoke(new WorkspaceHomeChange(server, change.ProjectId, change.Change));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user