Adobe-CEP / CEP-Resources

Tools and documentation for building Creative Cloud app extensions with CEP
https://www.adobe.io/apis/creativecloud/cep.html
1.62k stars 824 forks source link

Debugger statements causing extensions to reset #73

Open boredstiff opened 8 years ago

boredstiff commented 8 years ago

Putting in a line that simply says

debugger

which should act as a breakpoint is causing the extension to reset. It flashes white, then the extension starts over from the main entry point. I'm not testing this in other applications, but it's happening in Premiere 2015.3 and didn't occur in 2015, 2015.1 or 2015.2

yugguo commented 8 years ago

Hello, could you please share more information about this issue?

  1. Does this issue occur on Windows, Mac or both?
  2. Which extension will reset? Could you please share the extension for investigation?
  3. If possible, please set LogLevel to 6 to collect PlugPlug and CEPHtmlEngine logs. Please refer to "Where are the Log Files" in https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_6.x/CEP_6.1_HTML_Extension_Cookbook.pdf for details.
boredstiff commented 8 years ago
  1. Windows 7 tested only, unfortunately I don't have time to test it on OSX.
  2. No, it's an internal extension.
yugguo commented 8 years ago

Hello, is it possible to collect PlugPlug and CEPHtmlEngine logs and record a video for reproduction?

jingtaotan commented 8 years ago

Hi @alexwidener, I have been facing a similar issue in Premiere 10.3 and 10.4 (aka 2015.3 and 2015.4). Identical to your case, it was not a problem in 2015.2 and before.

I have been trying to create a sample panel which reproduces the problem, but to no avail. So I am guessing it is due to the combination of JavaScript libraries or NodeJS modules which I use in my panel. We can't easily just send our panel to Adobe for analysis, as it has an <iframe> which loads the application UI from an intranet server.

What I have observed is that it tends to happen in callback functions, or in the .then() block of promise-based functions.

Another interesting observation:

  1. Put a breakpoint at e.g. line 10
  2. When execution reaches the breakpoint, panel crashes and reloads
  3. Put a breakpoint at e.g. line 8
  4. When execution reaches the breakpoint, panel doesn't crash and execution is paused there.
  5. Continue to step over line by line until past line 10. No crash.

So it only seems to happen when JavaScript executes and pauses on a problematic line, not when stepping over code line by line. But I have not spotted any pattern as to what makes a line of JavaScript code "problematic".

jingtaotan commented 8 years ago

@alexwidener does this only happen in callbacks invoked by NodeJS' process.nextTick() ?

I have managed to narrow down the cause of my debugger crashing problems to that specific scenario.

boredstiff commented 8 years ago

I'm currently not working on the project that was utilizing this - I'd have to follow up once I'm on the project again, I'll try and remember to do so. Apologies.

brad-pds commented 7 years ago

I have a similar problem as well, not related to debugger statements but more similar to what @jingtaotan mentioned, for me it appears to be callbacks when jumping from js to jsx and back and forth. Again I cannot come up with a reproducible scenario.

At seemingly random spots in the code the extension will unload and reload with no warning causing my task to be abandoned. I have not been able to find anything of value to me in the logs.

To expand on 'random spots in the code' -- I work in tech -- I know what its like to get tickets submitted this kind of complaint, there's nothing to troubleshoot but unfortunately my implementation is a private, internal application so I also cannot post code samples.

I can run the same task (same input params) over and over and most of the time it will work 100% and every so often, lets say 5 - 10% of the time it will experience a reload, this can happen at any point in the code. And I can re-run the job, with the same inputs and it will not reload, or possibly reload at a different point in the code. I have experienced this enough times to know that it is not my code or the specific job that is triggering the error.

Observed on: OSX 10.9.5 OSX 10.11.6 Premiere Pro 2015.4

For what its worth I will be upgrading to PP 2017 soon and have log files tracking these errors back for months, so I will update with the good or bad news in the future.