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

Workers doesn't work with ADL launch via Adobe Animate #399

Closed
itlancer opened this issue Jul 21, 2020 · 15 comments
Closed

Workers doesn't work with ADL launch via Adobe Animate #399

itlancer opened this issue Jul 21, 2020 · 15 comments

Comments

@itlancer
Copy link

Problem Description

Workers doesn't work with ADL launch via Adobe Animate. Worker actually cannot be started. No any exceptions or errors.
So AIR application that uses Worker cannot be tested with Adobe Animate.

It has been tested with multiple AIR versions (even with latest AIR 33.1.1.190), different Adobe Animate versions (even with latest 20.5) with different Windows and macOS devices with different OS versions.
Same problem in all cases.
It works fine with Flash Develop.
After packaging application and launching it (without ADL) it also works fine.

Tracker issue: https://tracker.adobe.com/#/view/AIR-4084050

Steps to Reproduce

Launch code below with Adobe Animate. It just start Worker and make trace inside it.
You should use Adobe Scout with enabled "Start sessions for ActionScript Workers" to see it better:
image

Application example with sources attached.
worker_bug.zip

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.system.Worker;
	import flash.system.WorkerDomain;
	
	public class WorkerBug extends Sprite {
		
		public function WorkerBug() {
			if (Worker.current.isPrimordial) {
				addEventListener(Event.ADDED_TO_STAGE, init);
			} else {
				trace("worker");//This line will not be executed because Worker not starting with ADL
			}
		}
		
		private function init(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			var worker:Worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes);
			worker.start();
		}
	}
}

Actual Result:
Worker actually not started. There is not trace from Worker and there is no Worker session with Adobe Scout.

Expected Result:
Worker will be started. You will see trace from it and you will see Worker session with Adobe Scout.

Known Workarounds

Use another IDE.

@itlancer
Copy link
Author

The same problem with VSCode.
Even with latest AIR SDK 33.1.1.698.

@ajwfrost
Copy link
Collaborator

Thought this might be due to Workers needing ADL to be run with "extendedDesktop" mode, but it doesn't seem like it, so this will need a bit more of an investigation...

@itlancer
Copy link
Author

@ajwfrost
With application descriptor I have
<supportedProfiles>extendedDesktop</supportedProfiles>

@ajwfrost
Copy link
Collaborator

Okay that should help :-) curiously it works when we run it up under a debug build of AIR, so will have to try debugging a release build...

@ajwfrost
Copy link
Collaborator

Hmm .. so actually it works okay with ADL from a command line?
.. and it also appears to work when running from VS Code? I get the worker running/output both from within VS Code and within Scout (although the background worker appears 'above' the primordial worker when I look at the list of streams in Scout).

I'll check with Animate at some point too...

@itlancer
Copy link
Author

@ajwfrost
From command line it works fine.
But with VS Code and Animate it Worker doesn't launches at all. Tried with and without debugging.

@ajwfrost
Copy link
Collaborator

It works for me from VS Code. Using the Bowler Hat "Debugger for SWF"... will check tomorrow on Animate.
image

@itlancer
Copy link
Author

@ajwfrost
I made another check with VS Code. Indeed, with isolated sample it works fine with VS Code. But with complex AIR project doesn't. Seems something wrong with MessageChannel or something else. I will check it and create new issue if it related to AIR.

But with Animate it doesn't work anyway.

@MalacTheLittle
Copy link

@ajwfrost Do you have any update on Animate issue?

@ajwfrost
Copy link
Collaborator

Hi

Sorry for the delay on this one .. we've found it's due to the debugger not coping with multiple inputs/threads; basically when a connection is first made to the debugger, the runtime is set to pause so that the debugger can pass it any requests for breakpoints etc.. but with the worker, the debugger isn't sending anything so the worker is just halted waiting to be resumed..

We can work around this for now, but it does seem as if the debugger still isn't able to pick up information from this other connection, which means that traces aren't coming out from the worker to Animate. You can see them happening in that Scout window though. There will need to be an update to the debugger at some point I guess....

So -> there will be a bug fix so that the workers do actually start when they're running with an active debugger like from Animate -> but the debug information (traces) and breakpoints won't work in a secondary worker.

thanks

@MalacTheLittle
Copy link

Traces and breakpoints would be nice, but they can be handled throughout messageChannel so it's not a priority. But without execution of worker it's really hard to work on development.
Looking forward for bug fix!

@itlancer
Copy link
Author

This fix will be great and allow to test multithreaded AIR applications.
May be in some future AIR debugger could support multithreaded debug with multiple outputs or something like that.

@itlancer
Copy link
Author

Fixed with latest AIR 50.
Thanks!

But with real complex application we still have troubles with related issue #2385

@ajwfrost
Copy link
Collaborator

ajwfrost commented Jan 9, 2023

@myflashlab adding you into this one too....
So, the change that we made above is going to be reverted because it's giving bad side-effects. To actually fix the issue, please use the FDB version below and put this into Animate:

  • close down Animate
  • find the ActionScript 3 'bin' folder: e.g. on Windows, C:\Program Files\Adobe\Adobe Animate 2023\Common\Configuration\ActionScript 3.0\bin
  • rename the existing fdb.jar file so you have a backup
  • unzip the below file into that folder

Note: FDB is provided under the terms of the below Apache license.
https://github.com/apache/flex-sdk/blob/master/LICENSE
fdb.zip

thanks

@MalacTheLittle
Copy link

Thanks Andrew!
I can confirm that adding fdb.jar to C:\Program Files\Adobe\Adobe Flash CC\Common\Configuration\ActionScript 3.0\bin solved the issue, so Adobe Flash CC is covered too.

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

3 participants