File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,23 @@ export class SpaceSync extends EventEmitter<SyncEvents> {
473473 await this . primary . deleteFile ( path ) ;
474474 snapshot . nonSyncedFiles . set ( path , secondaryMeta ) ;
475475 operations += 1 ;
476+ } else if (
477+ primaryMeta && secondaryMeta && snapshot . files . has ( path ) &&
478+ primaryMeta . size !== secondaryMeta . size
479+ ) {
480+ // Sizes differ despite matching timestamps — silent content change
481+ // (e.g. file truncated without mtime update). Treat as conflict.
482+ console . warn (
483+ "[sync]" ,
484+ `Size mismatch despite matching timestamps (${ primaryMeta . size } vs ${ secondaryMeta . size } bytes), forcing conflict resolution:` ,
485+ path ,
486+ ) ;
487+ operations += await this . options . conflictResolver (
488+ path ,
489+ snapshot ,
490+ this . primary ,
491+ this . secondary ,
492+ ) ;
476493 } else {
477494 // Nothing needs to happen
478495 if ( ! syncBack && secondaryMeta ) {
You can’t perform that action at this time.
0 commit comments