Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching to JS file while Live Development is connecting causes it to fail #12379

Open
core-ai-bot opened this issue Aug 31, 2021 · 18 comments
Open

Comments

@core-ai-bot
Copy link
Member

Issue by peterflynn
Friday Sep 06, 2013 at 23:51 GMT
Originally opened as adobe/brackets#5110


I could swear we fixed a bug just like this recently, but this occurs for me on master now...

  1. Open an HTML file and a JS file in the working set
  2. Go to the HTML file and click the Live Preview lightning bolt
  3. While Chrome is launching, switch to the JS file

Result:
Chrome stays on the gray "interstitial" page forever, and Brackets eventually shows a connection error dialog.

Expected:
Should still connect, since I was on a valid HTML file when I originally clicked it.
And if I wait on the HTML file until the connection succeeds, switching to the JS file at that point doesn't cause it to disconnect... so we're putting the user in a sort of race condition.

This is easy to hit if you're using Live Preview but what you actually want to work on is a CSS or JS file. You can't launch it from the file you're in (because of the "you must select an HTML file first" issue), so you quickly switch to the HTML file and then back to the file you actually care about.

Also, it's easier to hit on Win than Mac, because every Live Preview invocation means waiting for an instance of Chrome to launch from scratch -- much longer time period in which to hit the bug.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Sep 06, 2013 at 23:54 GMT


This didn't really work in earlier sprints either -- in Sprint 29, it causes Chrome to show the JS file's source in the browser tab, and in Sprint 30 the current bug (above) repros. So maybe not a high priority...

@core-ai-bot
Copy link
Member Author

Comment by lkcampbell
Saturday Sep 07, 2013 at 16:13 GMT


@peterflynn, I've actually run into this issue a few times myself, performing the exact scenario you describe above. When I did it last, I was using Sprint 29, and I thought the display of the source code was an odd, but intentional, way to address the problem.

Your Expected result make a lot more sense though. Especially since this behavior is now causing an error in the connection.

@core-ai-bot
Copy link
Member Author

Comment by njx
Monday Sep 16, 2013 at 18:17 GMT


Medium priority to@couzteau

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Wednesday Sep 18, 2013 at 23:55 GMT


I observed reviewing the launch code that the helper function _doLaunchAfterServerReady is calling _getCurrentDocument again - after the open function has already retrieved a ref top the current document.

I have set up a branch with a fix: jhagenst/fix-5110

I think the fix is good, but I have only seen a small fraction of the LiveDebugger code, hence I have the feeling I don't have sufficient insight. Thanks for a comment on wether the fix seems to do the right thing.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Thursday Sep 19, 2013 at 18:35 GMT


posted PR adobe/brackets#5268

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Sep 24, 2013 at 17:07 GMT


FBNC to@peterflynn

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Oct 04, 2013 at 18:55 GMT


Waiting until the "index.html-finding" code lands before regressing this

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Monday Oct 07, 2013 at 16:58 GMT


@peterflynn Please regress.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Oct 09, 2013 at 18:52 GMT


@couzteau When I follow the repro steps now, Chrome closes when I do step 3. I would expect it to continue connecting to the HTML file to that the outcome is the same as if I waited a few seconds more before clicking the JS file.

This is less nasty than getting stuck on the loading screen forever, so changing priority to Low... but reopening. Leaving Sprint unassigned for now.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Oct 09, 2013 at 18:54 GMT


Btw, it's possible this was working better when@couzteau's PR #5268 landed, but was broken subsequently when #5414 landed.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Wednesday Oct 09, 2013 at 22:12 GMT


@peterflynn I cannot repro what you describe. Can you show me. I do agree that it is not unlikely that there is relationship to #5414

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Saturday Mar 15, 2014 at 21:38 GMT


Added Brackets 1.0 milestone. This is similar to #5756 -- difference is that JS file is selected instead of HTML file.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Mar 17, 2014 at 21:21 GMT


I can repro now. In order to repro It's required that the HTML file launched in LivePreview is not named index.html

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Apr 11, 2014 at 16:58 GMT


Marking needs review to reconsider 1.0 in/out question later, once we know more about our 1.0 plans for the Live Preview architecture.

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

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday May 29, 2014 at 18:30 GMT


FBNC to@peterflynn . Switched Milestone from Brackets 1.0 to Release 40.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Jun 03, 2014 at 22:55 GMT


Forgot to re-assign to@peterflynn

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Jul 31, 2014 at 16:48 GMT


@peterflynn ping

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Sep 22, 2014 at 21:35 GMT


@peterflynn Can you verify this old FBNC issue?

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

No branches or pull requests

1 participant