Skip to content

fix: harden local replica synchronization - #400

Open
yunhaoli24 wants to merge 6 commits into
overleaf-workshop:masterfrom
yunhaoli24:codex/local-replica-sync-fixes
Open

fix: harden local replica synchronization#400
yunhaoli24 wants to merge 6 commits into
overleaf-workshop:masterfrom
yunhaoli24:codex/local-replica-sync-fixes

Conversation

@yunhaoli24

@yunhaoli24 yunhaoli24 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

  • Route HTTP traffic from all projects through one process-wide queue, honor Retry-After globally after HTTP 429, and reuse recent history updates to avoid redundant file-tree diff requests.
  • Debounce local watcher bursts and retry transient live uploads with bounded exponential delays.
  • Prevent destructive startup fallback: full remote-to-local sync only runs for an empty replica or when local hashes still match the checkpoint.
  • Pause synchronization without modifying either side when local and remote changes overlap, including parent-directory delete/rename conflicts.
  • Ignore dot-prefixed paths such as .output and all symbolic links before filesystem processing.
  • Fix the OT update direction for complete-file writes and report rejected Socket.IO updates with usable error details.
  • Restore the local-replica creation flow when a remote project is open, and detect stale persisted replica directories.
  • Rebuild local replica SCM state from .overleaf/settings.json after authentication expires, including reconnecting immediately after re-login.
  • Stop the reconnect loop caused by disposing the provider-owned VFS after successful local replica creation.
  • Isolate background project initialization from workspace-global collaboration, chat, history, SCM, status, and compile registrations.
  • Keep deterministic workspace-feature failures out of the connection retry loop.
  • Add structured connection and SCM-creation diagnostics with project ID, scheme, retry attempt, base URI, and original errors.
  • Keep sync-state writes batched and in place so .overleaf/sync-state.json does not churn.

Verification

  • npm run compile
  • npm run lint (0 errors; 1 pre-existing warning in pdfViewEditorProvider.ts)
  • git diff --check

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