fix(local-replica): Addresses the external-file-change regression described in #396. - #398
Conversation
|
I am not familiar with the local replica mode. But if the |
|
Thanks for asking @zeyugao. To clarify, “external changes” here means changes made to local files by tools outside the VS Code editor, such as scripts or AI coding tools. When this option is disabled, files saved in VS Code are still uploaded normally, and changes made on Overleaf are still pulled into the local replica. Only external modifications to existing local files are not uploaded automatically. Thus, users who need this can enable the option. It is disabled by default to avoid unintentionally syncing file changes caused by Git operations or build tools, as discussed in #299 and #323. |
|
It seems that it is more likely a workaround instead of a solution. But merge it for now and perhaps waiting for a conflict resolution like git. |
Changes
overleaf-workshop.localReplica.syncOnFileChange.enabled.localWatcher.onDidChangeto detect modifications made by external tools.Rationale
Commit
debdcb5replaced file-system change events withonDidSaveTextDocumentto prevent unwanted synchronization caused by Git operations and build tools (#299 and #323).However, changes made outside the VS Code editor, such as edits from scripts or AI coding tools, no longer produce an editor-save event and therefore are not uploaded.
This change provides an explicit opt-in for users who need external-file synchronization while preserving the current safer behavior by default. When the option is enabled, changes made by Git or build tools may also be synchronized.
This PR only restores the missing external-file-change trigger. It does not change the
bypassCache, OT conflict handling, or merge implementation. The Windows path comparison handled separately by #397 is also outside the scope of this PR.Testing
npm run compile— passednpm run lint— passed with two pre-existing warningsgit diff --check— passed