This commit is contained in:
Andras Schmelczer 2025-03-16 20:01:43 +00:00
parent 10568efebe
commit 7f6fe8a582
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 17 additions and 19 deletions

View file

@ -112,7 +112,7 @@ export class SyncService {
contentBytes: Uint8Array;
}): Promise<components["schemas"]["DocumentUpdateResponse"]> {
this.logger.debug(
`Updating document ${documentId} with parent version ${parentVersionId} & ${new TextDecoder().decode(contentBytes)} & ${relativePath}`
`Updating document ${documentId} with parent version ${parentVersionId} and relative path ${relativePath}`
);
const formData = new FormData();
formData.append("parent_version_id", parentVersionId.toString());

View file

@ -105,9 +105,11 @@ export class UnrestrictedSyncer {
public async unrestrictedSyncLocallyUpdatedFile({
oldPath,
document
document,
force = false
}: {
oldPath?: RelativePath;
force?: boolean;
document: DocumentRecord;
}): Promise<void> {
await this.executeSync(
@ -131,7 +133,8 @@ export class UnrestrictedSyncer {
if (
document.metadata.hash === contentHash &&
oldPath === undefined
oldPath === undefined &&
!force
) {
this.logger.debug(
`File hash of ${document.relativePath} matches with last synced version and the path hasn't changed; no need to sync`
@ -270,7 +273,8 @@ export class UnrestrictedSyncer {
}
return this.unrestrictedSyncLocallyUpdatedFile({
document
document,
force: true
});
} else if (remoteVersion.isDeleted) {
// Either the doc hasn't made it to us before and therefore we don't need to delete it,

View file

@ -39,8 +39,7 @@ module.exports = [
filename: "sync-client.web.js",
library: {
name: "SyncClient",
type: "umd",
export: "default"
type: "umd"
},
globalObject: "this"
}