brackets-archive / brackets-shell

CEF3-based application shell for Brackets.
http://brackets.io
MIT License
0 stars 0 forks source link

[CLOSED] Fix Brackets Live Development Issues with Chrome OSX #230

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by fungl164 Monday Oct 21, 2013 at 16:25 GMT Originally opened as https://github.com/adobe/brackets-shell/pull/359


This provides better real-time detection/separation of Chrome debug sessions, as well as better connectivity + window/tab management from within Brackets.

This requires brackets pull request https://github.com/adobe/brackets/pull/5569


fungl164 included the following code: https://github.com/adobe/brackets-shell/pull/359/commits

core-ai-bot commented 3 years ago

Comment by redmunds Monday Oct 21, 2013 at 21:38 GMT


This seems to work, but I'm hitting a crash. Try this:

  1. Open Brackets and a Chrome window
  2. Start LD and it opens a second Chrome window
  3. Stop LD and it closes Chrome window that it opened
  4. Switch to Chrome and press Cmd-Q to quit

Results Brackets crashes. Let me know if you want me to post a crash log.

FYI, I was already happy with the functionality of how LD was working with Chrome, so I'm not sure what your latest changes are trying to fix. Maybe try reverting commits back to this comment and work on figuring out the @try/@catch problem.

core-ai-bot commented 3 years ago

Comment by fungl164 Tuesday Oct 22, 2013 at 03:40 GMT


Indeed, that is a bug created by the improper filtering of the workspace notification messages. This should be fixed with the latest update. Just needed to turn on process id caching for comparing and filtering out useless shutdown notifications.

I had it working like that before, but inadvertently took it out when implementing real-time lookups thinking it was not necessary. Turns out, it is required since its the only way to ensure we only pass through the appropriate shutdown notification(s) for LiveBrowser session cleanup.

Try it and let me know...

core-ai-bot commented 3 years ago

Comment by fungl164 Tuesday Oct 22, 2013 at 03:55 GMT


I'm not sure what your latest changes are trying to fix...

the latest changes implement the notes as described in https://github.com/adobe/brackets/pull/5569#discussion_r7094572

core-ai-bot commented 3 years ago

Comment by redmunds Tuesday Oct 22, 2013 at 15:58 GMT


That fixed the crash I described, but I found a slightly different one:

  1. With Chrome closed, start LD from Brackets
  2. Switch to Chrome: File > New Window
  3. Switch back to Brackets: stop LD (only window opened by Brackets is closed)
  4. Switch to Chrome: Cmd-Q to quit

Results Brackets crashes

core-ai-bot commented 3 years ago

Comment by fungl164 Tuesday Oct 22, 2013 at 16:49 GMT


@redmunds good catch. Needed to stop processing shutdown notifications when CloseLiveBrowser succeeds. Try the above patch.

core-ai-bot commented 3 years ago

Comment by redmunds Tuesday Oct 22, 2013 at 16:56 GMT


That seems to fix it.

core-ai-bot commented 3 years ago

Comment by fungl164 Tuesday Oct 22, 2013 at 17:01 GMT


I may have to do a minor update to CloseLiveBrowser() to ensure notifications are set/unset properly.

core-ai-bot commented 3 years ago

Comment by redmunds Wednesday Oct 23, 2013 at 21:04 GMT


I took a closer look at the compile problem with @try/@catch. I think the problem is that the function format is C++, not Objective-C, so it doesn't allow any Objective-C in the function. So, I converted @try to try and @catch to catch and it now compiles successfully. Does that also fix it on your end? More importantly, does the code work correctly? :)

core-ai-bot commented 3 years ago

Comment by fungl164 Wednesday Oct 23, 2013 at 21:36 GMT


Yes. Doing a catch all in C++ will most likely work with any version of XCode; especially since we're just reporting nil on failure. Want me to patch it up this way then?

core-ai-bot commented 3 years ago

Comment by redmunds Wednesday Oct 23, 2013 at 21:55 GMT


Yes, I think that's a good way to go (for now, anyway).

core-ai-bot commented 3 years ago

Comment by fungl164 Wednesday Oct 23, 2013 at 22:15 GMT


Ok. Let me know if you find anything else while testing. I think we're very close. :)

core-ai-bot commented 3 years ago

Comment by equiet Friday Oct 25, 2013 at 22:36 GMT


Found a bug.

  1. Open Brackets.
  2. Click Live Preview.
  3. When Chrome launches, open DevTools.
  4. Brackets crash ("Brackets quit unexpectedly.")

You can continue...

  1. Click Reopen.
  2. Quit Chrome.
  3. Click Live Preview.
  4. Brackets crash.
core-ai-bot commented 3 years ago

Comment by fungl164 Friday Oct 25, 2013 at 23:44 GMT


@equiet I cannot replicate this error. Are you using the corresponding patch (see https://github.com/adobe/brackets/pull/5569) as well?

core-ai-bot commented 3 years ago

Comment by equiet Saturday Oct 26, 2013 at 09:13 GMT


Yes, I am.

brackets is on pr/5569 brackets-shell is on pr/359 Chrome: 30.0.1599.101 OS: 10.8.5

It is very unpredictable and happens only for the first time when Brackets is launched. Otherwise you correctly see "Live preview was cancelled because the browser's development tools were opened".

core-ai-bot commented 3 years ago

Comment by fungl164 Saturday Oct 26, 2013 at 15:20 GMT


@equiet Well, I haven't been able to make Brackets crash following your steps + other variations thereof.
I've made some minor adjustments that may help if you'd like to try them. Let me know how it goes. Best.

core-ai-bot commented 3 years ago

Comment by equiet Saturday Oct 26, 2013 at 16:20 GMT


@fungl164 Awesome, doesn't crash anymore.

However, I found a new way how to crash Brackets:

  1. Open Brackets.
  2. Click Live Preview.
  3. Open DevTools in Chrome, Live Preview gets cancelled.
  4. Close Chrome tab (Chrome won't quit).
  5. Click Live Preview.
  6. You will get "Connecting to Browser" window, asking you to Relaunch Chrome.
  7. Click Cancel.
  8. Quit Chrome.
  9. "Brackets quit unexpectedly".

It's not a big issue though, since these steps are quite unlikely to be followed. Generally it's much more stable, thanks.

core-ai-bot commented 3 years ago

Comment by fungl164 Saturday Oct 26, 2013 at 18:25 GMT


@equiet try the latest update to https://github.com/adobe/brackets/pull/5569 and let me know.

core-ai-bot commented 3 years ago

Comment by equiet Saturday Oct 26, 2013 at 19:05 GMT


@fungl164 That fixed it.

One more issue, though:

  1. Open Brackets.
  2. Click Live Preview.
  3. Open DevTools in Chrome, Live Preview gets cancelled.
  4. Click Live Preview.
  5. About 70% of the time this results in "Live Preview Error" message and new tab with only the Brackets logo. (After clicking Live Preview again, it works.)
core-ai-bot commented 3 years ago

Comment by fungl164 Saturday Oct 26, 2013 at 19:52 GMT


@equiet Hmmm...interesting. I don't experience that. After step 4, I always get a properly working Live Preview on a new tab.
Try deleting your cache folder located at ~/Library/Application Support/Brackets/cef_data and restart Brackets. Let me know if that helps.

core-ai-bot commented 3 years ago

Comment by equiet Saturday Oct 26, 2013 at 20:37 GMT


Nope, deleting the cache didn't help.

core-ai-bot commented 3 years ago

Comment by fungl164 Saturday Oct 26, 2013 at 20:53 GMT


70% vs 0% give or take seems like a huge discrepancy. I'd be interested in hearing what others are experiencing. I hope for now things are more stable at your end. :)

core-ai-bot commented 3 years ago

Comment by equiet Saturday Oct 26, 2013 at 21:02 GMT


Yes, sure. Even with this (rather minor) issue it is definitely a better UX than having to restart Chrome.

core-ai-bot commented 3 years ago

Comment by fungl164 Saturday Oct 26, 2013 at 21:06 GMT


Great! Thnxs for the feedback...

core-ai-bot commented 3 years ago

Comment by redmunds Thursday Oct 31, 2013 at 16:43 GMT


@fungl164 Sorry for not working on this for the last week -- we were closing out Sprint 33. I'd like to get this in to Sprint 34. Are you going to be available to work on this for the next week or 2? If so, I want to merge this into master by early next week to get a lot of people using it, then we can react to any bugs that are found. Let me know.

core-ai-bot commented 3 years ago

Comment by fungl164 Thursday Oct 31, 2013 at 21:51 GMT


@redmunds Sure, I'll do as much as time permits. Just let me know what you want to focus on.

core-ai-bot commented 3 years ago

Comment by redmunds Thursday Oct 31, 2013 at 22:14 GMT


Cool. We had our Sprint 34 Planning Meeting today and we're going to try to get this in. I'll make a final pass through the code in the next day or so looking for anything that needs to be cleaned up. Go ahead and push changes for any last cleanup you want to do. One other person from the team is going to do some testing. When we're happy with the code, we'll need to squash all of the commits into a single commit and then merge into master. After that, I'll let you know if any bugs are found.

core-ai-bot commented 3 years ago

Comment by fungl164 Friday Nov 01, 2013 at 02:30 GMT


@redmunds NP. The last action was updating to the latest code from master. No visible/notable issues found.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Nov 01, 2013 at 19:01 GMT


The interaction with different instances of Chrome is working great!

I found this crasher when try to use Dev Tools:

  1. Shutdown Chrome (not sure if this is important)
  2. Start Brackets
  3. Debug > Show Developer Tools
  4. Start Live Dev

    Crash


Process: Brackets [16391] Path: /Users/USER/*/Brackets.app/Contents/MacOS/Brackets Identifier: io.brackets.appshell Version: 0.33.0 (0.33.0) Code Type: X86 (Native) Parent Process: launchd [180] User ID: 501

Date/Time: 2013-11-01 11:55:46.388 -0700 OS Version: Mac OS X 10.8.5 (12F45) Report Version: 10

Interval Since Last Report: 273213 sec Crashes Since Last Report: 18 Per-App Interval Since Last Report: 58943 sec Per-App Crashes Since Last Report: 17 Anonymous UUID: 451F2FD3-70D8-B281-6D0B-18470F4E23E0

Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000

VM Regions Near 0: --> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] ---/--- SM=NUL /Users/USER/*/Brackets.app/Contents/MacOS/Brackets VM_ALLOCATE 0000000000001000-000000000005d000 [ 368K] ---/--- SM=NUL

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread 0 io.brackets.appshell 0x00074b15 LiveBrowserMgrMac::CloseLiveBrowserFireCallback(int) + 21 1 io.brackets.appshell 0x000778e6 -[ChromeWindowsTerminatedObserver appTerminated:] + 390 2 com.apple.Foundation 0x907b2e52 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 +

core-ai-bot commented 3 years ago

Comment by couzteau Friday Nov 01, 2013 at 21:19 GMT


I have a different steps to repro the same crasher:

  1. quit chrome
  2. launch []s, auto open getting started
  3. open dev tools
  4. open live dev

Process: Brackets [28084] Path: /Edge/*/Brackets.app/Contents/MacOS/Brackets Identifier: io.brackets.appshell Version: 0.33.0 (0.33.0) Code Type: X86 (Native) Parent Process: launchd [488] Responsible: Brackets [28084] User ID: 503

Date/Time: 2013-11-01 14:01:24.423 -0700 OS Version: Mac OS X 10.9 (13A603) Report Version: 11 Anonymous UUID: D9BA809F-69F0-7413-CF99-909701F44E92

Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000

VM Regions Near 0: --> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] ---/--- SM=NUL /Edge/*/Brackets.app/Contents/MacOS/Brackets VM_ALLOCATE 0000000000001000-00000000000da000 [ 868K] ---/--- SM=NUL

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread 0 io.brackets.appshell 0x000f17d5 LiveBrowserMgrMac::CloseLiveBrowserFireCallback(int) + 21 1 io.brackets.appshell 0x000f46c6 -[ChromeWindowsTerminatedObserver appTerminated:] + 390 2 com.apple.Foundation 0x91357692 57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 49 3 com.apple.CoreFoundation 0x933937e4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 20 4 com.apple.CoreFoundation 0x932753fb _CFXNotificationPost + 3435 5 com.apple.Foundation 0x91345ebf -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 6 com.apple.AppKit 0x93dcd4c0 applicationStatusSubsystemCallback + 474 7 com.apple.LaunchServices 0x90a21df4 _LSScheduleNotificationFunction_block_invoke_2 + 73 8 com.apple.CoreFoundation 0x932eace0 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 16 9 com.apple.CoreFoundation 0x932dbb79 CFRunLoopDoBlocks + 361

core-ai-bot commented 3 years ago

Comment by fungl164 Friday Nov 01, 2013 at 23:19 GMT


@redmunds @couzteau Your reports confirmed we no longer need to check for 'enableRemoteDebugging' since this is true all the time now. :)

Let me know if your problems still persist after this last update...thnxs.