E1: le copie della cartella generale tornano con l'account, un rifiuto per ogni CHECK (#58)
La seconda revisione ha trovato che le copie della cartella generale di un account rimosso e aggiunto di nuovo restavano orfane per sempre: una «Tolto» o «Superato» senza file da adottare si sarebbe ricopiata da sola, contro §4.10. - export_copy tiene identificativo Instagram e nome dell'account rimosso, solo sulle copie orfane (CHECK, ix_export_copy_orphan); AccountStore.DeleteAsync li scrive. - RelinkOrphanCopiesAsync ridà all'account le sue copie della cartella generale, per identificativo o, se la copia non lo ha, per nome; AddAsync, UpdateAsync e RenameAsync lo chiamano nella loro transazione. La cartella propria resta ad AttachDestinationAsync. - Ogni CHECK della 0003 ha una prova di rifiuto su una riga valida per tutti gli altri; ambito, variante e formato sconosciuti si controllano anche sullo schema. - SPECIFICA §4.10 e §8.3, decisioni.md e stato.md aggiornati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ea4666d49b
commit
980212fb50
10 files changed
+470
-32
No files matched your search
@@ -30,11 +30,17 @@ public interface IAccountStore
|
||||
|
||||
Task<AccountStats> GetStatsAsync(long accountId, CancellationToken ct = default);
|
||||
|
||||
/// <summary>Adds an account and returns it with its key.</summary>
|
||||
/// <summary>
|
||||
/// Adds an account and returns it with its key. In the same transaction the account gets back its orphan copies of
|
||||
/// the general export folder, if it was removed before (<see cref="IExportStore.RelinkOrphanCopiesAsync"/>).
|
||||
/// </summary>
|
||||
/// <exception cref="DuplicateRecordException">Another account has the same Instagram identifier, or is already «Tu».</exception>
|
||||
Task<Account> AddAsync(Account account, CancellationToken ct = default);
|
||||
|
||||
/// <summary>Replaces every field of an existing account (settings screen).</summary>
|
||||
/// <summary>
|
||||
/// Replaces every field of an existing account (settings screen); with its Instagram id and user name written, it
|
||||
/// gets back its orphan copies of the general export folder as in <see cref="AddAsync"/>.
|
||||
/// </summary>
|
||||
Task UpdateAsync(Account account, CancellationToken ct = default);
|
||||
|
||||
Task SetStateAsync(long accountId, AccountState state, DateTimeOffset at, UnreachableReason? reason = null, CancellationToken ct = default);
|
||||
@@ -47,7 +53,8 @@ public interface IAccountStore
|
||||
|
||||
/// <summary>
|
||||
/// Records a rename seen in the data (spec §4.2): updates the user name, keeps the folder (a default folder is
|
||||
/// pinned to the old name) and raises the «Renamed» notice.
|
||||
/// pinned to the old name) and raises the «Renamed» notice; with the new name, the account gets back its orphan copies
|
||||
/// of the general export folder as in <see cref="AddAsync"/>.
|
||||
/// </summary>
|
||||
Task RenameAsync(long accountId, string newUsername, DateTimeOffset at, CancellationToken ct = default);
|
||||
|
||||
@@ -61,7 +68,8 @@ public interface IAccountStore
|
||||
/// Removes the account record and, by cascade, its entries, files records and highlights. Files on disk are not
|
||||
/// touched: removing an account with its files is a library operation, and the default is to keep them and make
|
||||
/// the account «Solo archivio» (spec §4.2). Its export destinations stay, without account and with the user name;
|
||||
/// its «Esporta questo account» choice goes with it (spec §4.10).
|
||||
/// its export copies stay, without account and with its Instagram id and user name, so they come back if the account
|
||||
/// is added again; its «Esporta questo account» choice goes with it (spec §4.10).
|
||||
/// </summary>
|
||||
Task DeleteAsync(long accountId, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
@@ -99,12 +99,26 @@ public interface IExportStore
|
||||
Task<IReadOnlyDictionary<ExportCopyState, int>> CountCopiesAsync(long destinationId, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Re-links an orphan row (account removed) to a re-added account, when its file is adopted again.
|
||||
/// Re-links an orphan row (account removed) to a re-added account, when its file is adopted again, and forgets the
|
||||
/// removed account kept on it.
|
||||
/// <see cref="KeyNotFoundException"/> for a missing id; <see cref="InvalidOperationException"/> if the row is not an orphan;
|
||||
/// <see cref="DuplicateRecordException"/> if the account already has a current copy of that identity.
|
||||
/// </summary>
|
||||
Task<ExportCopy> RelinkOrphanCopyAsync(long copyId, long accountId, long? mediaId, DateTimeOffset at, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// Gives an account its orphan copies of the general folder (retired rows included), in every state, so a Removed or
|
||||
/// Superseded copy is never copied again by itself after the account was removed and added again (spec §4.10). A row
|
||||
/// matches by the Instagram id of the removed account when the row has one (only an account with that id), else by
|
||||
/// its user name, ignoring ASCII case. A current (Copied or Failed) row comes back only as the newest of its identity
|
||||
/// and only if the account has no current row of that identity: the others stay orphans. Copies of an own folder
|
||||
/// come back only with <see cref="AttachDestinationAsync"/>. Uses the account's current Instagram id and user name;
|
||||
/// <c>IAccountStore</c> already runs it when an account is added or its id or name is written, so callers need it
|
||||
/// only after writing those columns some other way. Returns the rows re-linked; <see cref="KeyNotFoundException"/>
|
||||
/// for a missing account.
|
||||
/// </summary>
|
||||
Task<int> RelinkOrphanCopiesAsync(long accountId, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// The library file of an account changed from <paramref name="oldSha256"/> to <paramref name="newSha256"/>: its
|
||||
/// Copied rows of the old file become Superseded, its Removed rows of the old file get the new SHA-256, and its rows
|
||||
|
||||
Reference in new issue
Block a user