Skip to content

fix(local-replica): handle Windows paths when syncing saved documents - #397

Open
Rinfly wants to merge 1 commit into
overleaf-workshop:masterfrom
Rinfly:issue-394
Open

fix(local-replica): handle Windows paths when syncing saved documents#397
Rinfly wants to merge 1 commit into
overleaf-workshop:masterfrom
Rinfly:issue-394

Conversation

@Rinfly

@Rinfly Rinfly commented Jul 27, 2026

Copy link
Copy Markdown

Fix (#394) Local Replica uploads on Windows when a document is saved from VS Code.

In v0.15.10, Local Replica synchronization was changed to upload files from onDidSaveTextDocument instead of reacting to all filesystem changes. The saved document was then checked using a case-sensitive URI string prefix comparison:

docUri.path.startsWith(basePath)

On Windows, the project URI and document URI may represent the same filesystem path with different drive-letter or path casing. In that case, the prefix check fails and the save event is silently ignored, so syncToVFS() is never called.

Changes

  • Use filesystem paths through Uri.fsPath.
  • Resolve the project and document paths with path.resolve().
  • Use path.relative() to determine whether the saved document is inside the Local Replica directory.
  • Reject non-file URIs.
  • Reject paths outside the project directory, including sibling directories and paths on another Windows drive.

This preserves the v0.15.10 save-only synchronization behavior. It does not restore filesystem-change uploads, so changes made by Git, compilers, or other external processes are not automatically pushed.

Testing

  • npm run compile
  • npm test
  • Packaged and installed the extension locally on Windows 11.
  • Opened an Overleaf project using Open Project Locally.
  • Edited and saved main.tex and verified that the change was uploaded to Overleaf.

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