API refinements
This commit is contained in:
+10
-1
@@ -245,6 +245,16 @@ export class SyncService {
|
||||
}
|
||||
try {
|
||||
remoteHash = (await this.remoteSpace!.getFileMeta(name)).lastModified;
|
||||
if (!remoteHash) {
|
||||
console.info(
|
||||
"Not syncing file, because remote didn't send X-Last-Modified header",
|
||||
);
|
||||
// This happens when the remote isn't a real SilverBullet server, specifically: it's not sending
|
||||
// a X-Last-Modified header. In this case we'll just assume that the file is up to date.
|
||||
await this.registerSyncStop(false);
|
||||
// Jumping out, not saving snapshot nor triggering a sync event, because we did nothing
|
||||
return;
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e.message === "Not found") {
|
||||
// File doesn't exist remotely, that's ok
|
||||
@@ -264,7 +274,6 @@ export class SyncService {
|
||||
}
|
||||
await this.saveSnapshot(snapshot);
|
||||
await this.registerSyncStop(false);
|
||||
// console.log("And done with file sync for", name);
|
||||
}
|
||||
|
||||
async saveSnapshot(snapshot: Map<string, SyncStatusItem>) {
|
||||
|
||||
Reference in New Issue
Block a user