omg it mostly works for deletes
This commit is contained in:
parent
054d109ef8
commit
d23c1a8dbc
6 changed files with 243 additions and 139 deletions
|
|
@ -71,15 +71,12 @@ export class FileOperations {
|
|||
`Didn't expect ${path} to exist, deconflicting by moving it to '${deconflictedPath}'`
|
||||
);
|
||||
|
||||
const document = this.database.getDocumentByRelativePath(path);
|
||||
const document =
|
||||
this.database.getLatestDocumentByRelativePath(path);
|
||||
this.logger.debug(
|
||||
`Existing metadata for ${path}: ${JSON.stringify(document?.metadata)}`
|
||||
);
|
||||
|
||||
this.logger.debug(
|
||||
`We need to save what's at ${path} to ${deconflictedPath}`
|
||||
);
|
||||
|
||||
if (
|
||||
document?.metadata !== undefined &&
|
||||
document.metadata.documentId === documentId
|
||||
|
|
@ -94,7 +91,6 @@ export class FileOperations {
|
|||
`We need to save what's at ${path} to ${deconflictedPath}`
|
||||
);
|
||||
await this.move(path, deconflictedPath, documentId);
|
||||
// this.database.move(path, deconflictedPath);
|
||||
} else {
|
||||
await this.createParentDirectories(path);
|
||||
}
|
||||
|
|
@ -178,7 +174,8 @@ export class FileOperations {
|
|||
`Conflict when moving '${oldPath}' to '${newPath}', the latter already exists, deconflicting by moving it to '${deconflictedPath}'`
|
||||
);
|
||||
|
||||
const document = this.database.getDocumentByRelativePath(newPath);
|
||||
const document =
|
||||
this.database.getLatestDocumentByRelativePath(newPath);
|
||||
|
||||
if (
|
||||
document?.metadata !== undefined &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue