Fix race condition of client-side path deconflicting
This commit is contained in:
parent
952e89343a
commit
10bde4bc3a
4 changed files with 77 additions and 28 deletions
|
|
@ -87,15 +87,6 @@ export class UnrestrictedSyncer {
|
|||
contentBytes
|
||||
});
|
||||
|
||||
this.database.updateDocumentMetadata(
|
||||
{
|
||||
parentVersionId: response.vaultUpdateId,
|
||||
hash: contentHash,
|
||||
remoteRelativePath: response.relativePath
|
||||
},
|
||||
document
|
||||
);
|
||||
|
||||
// In case a document with the same name (but different ID) had existed remotely that we haven't known about
|
||||
if (response.relativePath != originalRelativePath) {
|
||||
this.logger.debug(
|
||||
|
|
@ -107,6 +98,15 @@ export class UnrestrictedSyncer {
|
|||
); // this can throw FileNotFoundError
|
||||
}
|
||||
|
||||
this.database.updateDocumentMetadata(
|
||||
{
|
||||
parentVersionId: response.vaultUpdateId,
|
||||
hash: contentHash,
|
||||
remoteRelativePath: response.relativePath
|
||||
},
|
||||
document
|
||||
);
|
||||
|
||||
this.database.addSeenUpdateId(response.vaultUpdateId);
|
||||
this.updateCache(
|
||||
response.vaultUpdateId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue