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

Assertion failing in DocumentManager #1543

Closed
peterflynn opened this issue Sep 1, 2012 · 5 comments
Closed

Assertion failing in DocumentManager #1543

peterflynn opened this issue Sep 1, 2012 · 5 comments

Comments

@peterflynn
Copy link
Member

  1. Add two files to the working set
  2. Restart Brackets
  3. Close the file that was initially reopened

Result: Log contains message about an assertion failing in DocumentManager.closeFullEditor()

This is a result of migrating to brackets-shell: the FILE_OPEN command no longer completes synchronously in cases where it has to load the file off disk for the first time, so _currentDocument has not actually changed at all by the time we get to the assertion.

@peterflynn
Copy link
Member Author

We could just remove the assertion, or move it into a done() handler on the FILE_OPEN call. But if it really might take a while, it'd be cleaner to also move the removeFromWorkingSet() call after the FILE_OPEN -- it's weird to see the current-item highlight disappear and then that file remains in the editor for a beat afterward. But that raises the question of what happens in the fail() case (is the doc you just tried to close left open?).

Although if it takes a while, it's ugly no matter what -- you can still type in the editor for a second and then your changes will be lost without warning (even if you said "Save" to an unsaved changes prompt a moment earlier). That seems like yet another separate async bug, though -- we'd need some intermediate UI in between killing the closed file's editor and being able to show the newly-opened file.

@peterflynn
Copy link
Member Author

Turns out the fail() case is already fairly broken -- see #1544

@ghost ghost assigned peterflynn Sep 4, 2012
@pthiess
Copy link
Contributor

pthiess commented Sep 4, 2012

Reviewed and assigned to Randy.

@ghost ghost assigned redmunds Sep 4, 2012
peterflynn added a commit that referenced this issue Sep 6, 2012
Fix bugs #1543 and #1544: working set files are not guaranteed to be openable, so check for failure; defer assertion until it's (supposed to be) guaranteed to be valid
@redmunds
Copy link
Contributor

redmunds commented Sep 6, 2012

FBNC back to @peterflynn

@peterflynn
Copy link
Member Author

Confirmed fixed

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