diff --git a/i18n/en/Errors.resx b/i18n/en/Errors.resx index c1581591..e6c1f139 100644 --- a/i18n/en/Errors.resx +++ b/i18n/en/Errors.resx @@ -53,6 +53,7 @@ Its local copy could not be removed now: Remove local copy takes it later.long {0} did not match its source after it was copied.{0} file path A file of this project in the workspace cannot be read; the log names it. + This project was deleted in the library; nothing was removed. Discard changes removes its local copy. The workspace drive needs {0} GB more for this copy.{0} gigabytes missing The last edit could not be stored yet; it is tried again, try once more in a moment. The library's copy of this project does not match what was sent; nothing was removed. diff --git a/i18n/it/Errors.it.resx b/i18n/it/Errors.it.resx index 84954535..82039775 100644 --- a/i18n/it/Errors.it.resx +++ b/i18n/it/Errors.it.resx @@ -53,6 +53,7 @@ La sua copia locale ora non è stata rimossa: Rimuovi copia locale la toglie più tardi. {0} non corrispondeva all'originale dopo la copia. Un file di questo progetto nello spazio di lavoro non è leggibile; il log lo indica. + Questo progetto è stato eliminato nella libreria; non è stato rimosso nulla. Scarta modifiche rimuove la sua copia locale. Al disco dello spazio di lavoro servono altri {0} GB per questa copia. L'ultima modifica non è ancora stata memorizzata; viene ritentata, riprova tra un momento. La copia di questo progetto nella libreria non corrisponde a quanto inviato; non è stato rimosso nulla. diff --git a/src/Chronos.App/Workspace/WorkspaceHost.cs b/src/Chronos.App/Workspace/WorkspaceHost.cs index 45374e7c..c1e18d3f 100644 --- a/src/Chronos.App/Workspace/WorkspaceHost.cs +++ b/src/Chronos.App/Workspace/WorkspaceHost.cs @@ -600,6 +600,11 @@ public sealed class WorkspaceHost held = basis is not null && await home.HoldsAsync(projectId, head, cancellationToken).ConfigureAwait(false) && (basis.Id == head.Id || await home.HoldsAsync(projectId, basis, cancellationToken).ConfigureAwait(false)); } + catch (ProjectException ex) when (ex.Reason is ProjectError.NotFound or ProjectError.SequenceNotFound) + { + // Deleted at the home (its trash keeps every version sent): this copy goes only when its user discards it. + throw new WorkspaceException(Loc.L("Errors.Workspace.DeletedAtHome"), ex); + } catch (Exception ex) when (ex is HomeUnavailableException or ProjectException or DatabaseException) { throw new WorkspaceException(Loc.L("Errors.Workspace.Offline"), ex); diff --git a/src/Chronos.Data/Archiving/ArchiveIndexer.cs b/src/Chronos.Data/Archiving/ArchiveIndexer.cs index 7eb22a7d..0fc05c19 100644 --- a/src/Chronos.Data/Archiving/ArchiveIndexer.cs +++ b/src/Chronos.Data/Archiving/ArchiveIndexer.cs @@ -368,6 +368,11 @@ public sealed class ArchiveIndexer { Log.Warning("projects", $"The projects of {row.Folder} could not be read back; the next project operation tries again", ex); } + catch (DatabaseException ex) + { + // The index refused a project of this sequence: the scan goes on with the others, and the next project operation tries again. + Log.Warning("projects", $"The projects of {row.Folder} could not be indexed; the next project operation tries again", ex); + } } /// Indexes one folder; returns its sequence and the sidecar bytes when they were read and not rewritten since (for the snapshot). diff --git a/src/Chronos.Data/Projects/IProjectHome.cs b/src/Chronos.Data/Projects/IProjectHome.cs index 098ec3b8..d34d1222 100644 --- a/src/Chronos.Data/Projects/IProjectHome.cs +++ b/src/Chronos.Data/Projects/IProjectHome.cs @@ -27,7 +27,10 @@ public interface IProjectHome /// A new project named from (a version of any project of the sequence), or from Main's head. Task CreateAsync(string name, Guid? fromVersionId, string? author, CancellationToken cancellationToken); - /// The project's newest version. + /// + /// The project's newest version; a project deleted at the home has none (, + /// ), so a workspace's copy of it reads as gone, never as in step. + /// Task HeadAsync(Guid projectId, CancellationToken cancellationToken); /// A version of the project by id; null when the home has none. diff --git a/src/Chronos.Data/Projects/ProjectIndexer.cs b/src/Chronos.Data/Projects/ProjectIndexer.cs index 84401b38..a32ce0a9 100644 --- a/src/Chronos.Data/Projects/ProjectIndexer.cs +++ b/src/Chronos.Data/Projects/ProjectIndexer.cs @@ -53,11 +53,21 @@ internal sealed class ProjectIndexer(ChronosDatabase db) } catch (Exception ex) when (ex is IOException or InvalidDataException or UnauthorizedAccessException) { - Log.Warning("projects", $"The project in {directory} cannot be read; it stays as the index has it", ex); - // Its folder names it (, or -