@@ -17,7 +17,7 @@ import MetadataStore, {
1717} from "./metadata-store" ;
1818import EventsListener from "./events-listener" ;
1919import { GitHubSyncSettings } from "./settings/settings" ;
20- import Logger from "./logger" ;
20+ import Logger , { LOG_FILE_NAME } from "./logger" ;
2121import { decodeBase64String , hasTextExtension } from "./utils" ;
2222import GitHubSyncPlugin from "./main" ;
2323import { BlobReader , Entry , Uint8ArrayWriter , ZipReader } from "@zip.js/zip.js" ;
@@ -233,6 +233,14 @@ export default class SyncManager {
233233 return ;
234234 }
235235
236+ if ( targetPath === `${ this . vault . configDir } /${ LOG_FILE_NAME } ` ) {
237+ // We don't want to download the log file if the user synced it in the past.
238+ // This is necessary because in the past we forgot to ignore the log file
239+ // from syncing if the user enabled configs sync.
240+ // To avoid downloading it we ignore it if still present in the remote repo.
241+ return ;
242+ }
243+
236244 if ( targetPath . split ( "/" ) . last ( ) ?. startsWith ( "." ) ) {
237245 // We must skip hidden files as that creates issues with syncing.
238246 // This is fine as users can't edit hidden files in Obsidian anyway.
@@ -417,6 +425,16 @@ export default class SyncManager {
417425 throw new Error ( "Remote manifest is missing" ) ;
418426 }
419427
428+ if (
429+ Object . keys ( files ) . contains ( `${ this . vault . configDir } /${ LOG_FILE_NAME } ` )
430+ ) {
431+ // We don't want to download the log file if the user synced it in the past.
432+ // This is necessary because in the past we forgot to ignore the log file
433+ // from syncing if the user enabled configs sync.
434+ // To avoid downloading it we delete it if still around.
435+ delete files [ `${ this . vault . configDir } /${ LOG_FILE_NAME } ` ] ;
436+ }
437+
420438 const blob = await this . client . getBlob ( { sha : manifest . sha } ) ;
421439 const remoteMetadata : Metadata = JSON . parse (
422440 decodeBase64String ( blob . content ) ,
0 commit comments