Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

File sync from disk can become parallel with any operation that shows a dialog #555

Closed
peterflynn opened this issue Apr 5, 2012 · 2 comments

Comments

@peterflynn
Copy link
Member

I haven't tried to find a specific case where this breaks very badly, but I have no doubt they exist.

Showing the basic problem, albeit only as a UI glitch, is easy though:

  1. Make some edits
  2. File > Close -- but leave the unsaved changes prompt open
  3. Leave Brackets and modify the same file on disk (do save your changes here)
  4. Return to Brackets

Result: the "External Changes" dialog appears on top of the unsaved changes prompt.
(Warning: be sure to dismiss the External Changes now. If you don't, and you leave the Brackets window with it still open, you'll hit #554 and be stuck force-quitting Brackets).

So now all the FileSyncManager operations are happening in the middle of what DocumentCommandHandlers.handleFileClose() probably thinks of as an atomic operation. This can happen with anything that might open a dialog in mid-operation -- the operation can unexpectedly become interleaved with FileSyncManager, as if we were multi-threaded. (Similarly, any operation that is triggered by something other than user input could take the place of FileSyncManager).

In a way, this is just another case of the general issue where sequenced operations that should feel atomic are not actually guaranteed to be so. It's just that most of those issues don't repro without truly async file I/O, whereas this case of it already repros in our code today.

@njx
Copy link
Contributor

njx commented Apr 10, 2012

QRB reviewed. Marking to user story--originally we were going to wait to handle these async issues until we started dealing with async file access (e.g. to github or dropbox), but this suggests that we should consider handling at least some of these issues earlier in a separate user story.

@pthiess
Copy link
Contributor

pthiess commented Apr 13, 2012

Added to BS --> story #306240

@pthiess pthiess closed this as completed Apr 13, 2012
gideonthomas added a commit to gideonthomas/brackets that referenced this issue Jun 26, 2016
Fix mozilla/thimble.mozilla.org#1478 - Regression causes fragment links to not work in preview
ficristo pushed a commit to quadre-code/quadre that referenced this issue Jan 16, 2019
…ccur.preferences.exclude_* from your brackers.json (Marco105)

Background color setting can contain CSS styles (treeno and atishay811)
Initial background setting is: background-color: adobe#555; opacity: 0.7; border-radius: 6px;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants