Skip to content

fix(local-replica): Addresses the external-file-change regression described in #396. - #398

Open
Heinz217 wants to merge 1 commit into
overleaf-workshop:masterfrom
Heinz217:fix/local-replica-external-file-sync
Open

fix(local-replica): Addresses the external-file-change regression described in #396.#398
Heinz217 wants to merge 1 commit into
overleaf-workshop:masterfrom
Heinz217:fix/local-replica-external-file-sync

Conversation

@Heinz217

@Heinz217 Heinz217 commented Aug 4, 2026

Copy link
Copy Markdown

Changes

  • Add the opt-in setting overleaf-workshop.localReplica.syncOnFileChange.enabled.
  • Keep editor-save-based synchronization as the default behavior.
  • When enabled, use localWatcher.onDidChange to detect modifications made by external tools.
  • Keep the file-system listener and editor-save listener mutually exclusive to avoid handling the same editor save through both listeners.
  • Keep the existing create and delete synchronization unchanged.

Rationale

Commit debdcb5 replaced file-system change events with onDidSaveTextDocument to 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 — passed
  • npm run lint — passed with two pre-existing warnings
  • git diff --check — passed
  • Manually tested on Windows with a Local Replica project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant