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

Live Preview loads wrong file when changing file quickly #4615

Closed
WebsiteDeveloper opened this issue Jul 31, 2013 · 14 comments
Closed

Live Preview loads wrong file when changing file quickly #4615

WebsiteDeveloper opened this issue Jul 31, 2013 · 14 comments

Comments

@WebsiteDeveloper
Copy link
Contributor

Steps to reproduce:

  1. Open a somewhat larger html file
  2. Start Live-Preview
  3. Quickly click on another file in your working files

Old Result:

The file opened in step 3 gets shown in Live-Preview

Current Result:
Live Preview does not open and "Unable to load Live Preview page" error is seen.

Expected:
Show the html file from step 3

@njx
Copy link
Contributor

njx commented Aug 5, 2013

@WebsiteDeveloper - I think this is working as designed; Live Preview is always supposed to switch to show the currently open HTML file, so in this case it should show the file from step 3. We've talked about making it possible to "lock" the live preview to a given file, but that's not implemented right now.

@njx njx closed this as completed Aug 5, 2013
@WebsiteDeveloper
Copy link
Contributor Author

@njx acually it opens any file type even js files ^ should have made that more clear

@njx njx reopened this Aug 5, 2013
@njx
Copy link
Contributor

njx commented Aug 5, 2013

Oh, that's bad :) Thanks for the clarification.

If you have any earlier sprints installed, would you mind seeing how far back this bug goes? I'm curious whether it's a recent regression.

@WebsiteDeveloper
Copy link
Contributor Author

will try out.

@WebsiteDeveloper
Copy link
Contributor Author

@njx it happens even in the oldest version i have currently installed which is Sprint 23 so it seems to be a pretty old regression.

@WebsiteDeveloper
Copy link
Contributor Author

@njx ping.

@redmunds
Copy link
Contributor

redmunds commented Mar 6, 2014

@WebsiteDeveloper Thanks for following up.

I was reviewing Live Preview bugs yesterday and missed this one. I still see this problem in latest code. #5756 is a duplicate of this one. #5110 is similar, but it switches to JS (not HTML) file. I tried to fix this in #6889, but it's still not quite right.

@redmunds redmunds self-assigned this Mar 6, 2014
@redmunds
Copy link
Contributor

redmunds commented Mar 6, 2014

Actually, I disagree with the Expected Results. If you change the selected HTML file in Brackets, then Live Preview should also change, right?

@WebsiteDeveloper
Copy link
Contributor Author

That's right.

@redmunds redmunds added this to the Brackets 1.0 milestone Mar 15, 2014
@redmunds
Copy link
Contributor

Added Brackets 1.0 milestone. Launching Live Preview is still kind of slow, so this is not difficult to hit.

What we need to do when LiveDevelopment._openDeferred resolves is to verify that DocumentManager.getCurrentDocument() is the same as _liveDocument. If not, navigate to DocumentManager.getCurrentDocument().

@njx
Copy link
Contributor

njx commented Apr 11, 2014

Reviewed. It seems like this isn't likely for many people to hit (because they wouldn't really be switching away right after launching), but the fix seems relatively straightforward. So, if we were to try to fix this, we'd want to timebox it, and bail if it gets complicated.

Moving to low priority. Leaving in the 1.0 milestone for now, but we should delay working on any of these live preview bugs until we know whether we're going to be migrating to the new non-CDT-based architecture for 1.0.

@peterflynn
Copy link
Member

Marking needs review to reconsider 1.0 in/out question later

@peterflynn
Copy link
Member

Also note: this might be a dupe of #5110 now that the description has been updated.

@redmunds
Copy link
Contributor

Confirmed. Closing. @WebsiteDeveloper Let us know if this is not fixed. Switching Milestone from Brackets 1.0 to Release 40

@redmunds redmunds modified the milestones: Release #40, Brackets 1.0 May 29, 2014
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

5 participants