Skip to content

Avoid blocking queued syncs on stale save errors#38

Open
mmtftr wants to merge 1 commit intocaenrigen:mainfrom
mmtftr:fix-nonblocking-stale-sync-errors
Open

Avoid blocking queued syncs on stale save errors#38
mmtftr wants to merge 1 commit intocaenrigen:mainfrom
mmtftr:fix-nonblocking-stale-sync-errors

Conversation

@mmtftr
Copy link
Copy Markdown

@mmtftr mmtftr commented Mar 12, 2026

Summary

Problem

When a sync triggered by onDidSaveTextDocument failed, the extension awaited
vscode.window.showErrorMessage(...). That kept the task promise unresolved and prevented the next queued
sync for the same file from starting.

Rapid consecutive saves also produced error output for obsolete sync attempts, even when a newer save had
already superseded the failing task.

Fix

  • stop awaiting the error popup in runJupytext
  • assign each save-triggered sync a monotonically increasing per-file version
  • only surface sync errors if the failing task is still the latest version for that file

Verification

(node 24.11.1)

  • npm run compile
  • npm run lint

@caenrigen
Copy link
Copy Markdown
Owner

Thanks for debugging it and the suggested fix

I will have to look at this into more detail when I find a bit of time, it touches on functions that are used for a few different purposes beside the sync

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.

Saving back to back error: jupytext.cli.SynchronousModificationError

2 participants