Opened 13 years ago

Closed 12 years ago

#2523 closed defect (fixed)

dojo.flash comm doesn't work on baked build with profile "storage"

Reported by: guest Owned by: bradneuberg
Priority: high Milestone: 1.2
Component: Storage/Flash Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

Dojo Version: 0.4.1 Browser: Firefox 2.0.0.2

Javascript flash communication does not work with compressed build of dojo.js built as follows:

$ ant clean -Dprofile=storage -Ddocless=true release gen-strip-docs compress

Steps to reproduce:

  1. Build dojo release with above command.
  2. Test unit test flash/test_comm_simple.html against this build.
  3. Note output like the following:

DEBUG: [TypeError: dojo.flash.comm.sayHello is not a function, file: http://localhost:5000/test_comm_simple.html, line: 32] when calling flashLoaded$joinpoint$method on [object Window] with arguments [object Object] FATAL exception raised: dojo.flash.comm.sayHello is not a function

SIDE NOTE: Our team is working on a project that may necessitate flash<->js comm and we have to use a single dojo.js (no require calls triggering more downloads). Compressing resources is also critical for the application.

Attachments (2)

dojo.js (107.1 KB) - added by guest 13 years ago.
storage profile dojo.js
debugging.tar.gz (134.1 KB) - added by guest 13 years ago.
sessions from Charles

Download all attachments as: .zip

Change History (15)

comment:1 Changed 13 years ago by James Burke

Milestone: 0.9M1
Resolution: invalid
Status: newclosed

I think the problem is trying to use the gen-strip-docs ant task. You do not need this since the normal build process runs it through the compressor and removes comments. The following ant command worked for me, and generates a compressed JS file:

ant -Dprofile=storage -Ddocless=true clean release

comment:2 Changed 13 years ago by guest

Resolution: invalid
Status: closedreopened

Thank you for responding so quickly to this. I've tested again, using your suggestion:

ant -Dprofile=storage -Ddocless=true clean release

with a freshly checked out copy of 0.4.1. But, going to my test environment http://localhost:5000/Dojo-0.4.1-fresh/release/dojo/tests/flash/test_comm_simple.html, I'm still getting: DEBUG: Flash is loaded DEBUG: [TypeError: dojo.flash.comm.sayHello is not a function, file: http://localhost:5000/Dojo-0.4.1-fresh/release/dojo/tests/flash/test_comm_simple.html, line: 32] when calling flashLoaded$joinpoint$method on [object Window] with arguments [object Object] FATAL exception raised: dojo.flash.comm.sayHello is not a function

I'm trying to convince my team to use dojo over prototype (wink, wink) - so this could be a show stopper ;)

I've attached the generated dojo.js file.

Thanks.

Changed 13 years ago by guest

Attachment: dojo.js added

storage profile dojo.js

comment:3 Changed 13 years ago by James Burke

Your dojo.js matches my dojo.js.

I believe the problem is that you are only copying dojo.js over to your server. dojo.flash depends on a few flash files that also need to be copied to your server. The general advice is to take everything in the release/dojo folder and put that on your server. There are other modules that depend on support files (like dojo.undo.browser and the widgets need images usually for their display).

Try copying over the entire build output directory to see if that fixes the problem.

I will leave the ticket open for now to wait for your response.

comment:4 Changed 13 years ago by guest

Thanks again for responding so quickly. I was actually going about this very carefully to ensure all the files are in place. I am testing using pylons as webserver and placed the Dojo-0.4.1 checkout of release-0.4.1 in my public directory - with permissions on everything to be globally readable (files 0644 and directories 0755). I am therefore running tests directly against the release/dojo:

http://localhost:5000/Dojo-0.4.1/release/dojo/tests/flash/test_comm_simple.html

Which fails, versus:

http://localhost:5000/Dojo-0.4.1/tests/flash/test_comm_simple.html

Which does not fail.

I'm attaching the output of ant ... which I don't think will help. If you like, I can email you a tarball of the whole Dojo-0.4.1 directory.

Thanks for your help.

comment:5 Changed 13 years ago by James Burke

You should verify (maybe by watching the traffic through a proxy server like Charles), that the swf file is being found and loaded by the browser. You should see the browser ask for tests/flash/resources/HelloWorld_version6.swf or tests/flash/resources/HelloWorld_version8.swf.

If that is working correctly (HTTP 200), then it seems like maybe that swf or something it depends on is corrupted. Not sure what to do with that. We might have to forward the issue to the person whoe wrote the flash stuff.

comment:6 Changed 13 years ago by guest

Wow, thanks for pointing me to Charles that's an awesome tool. So I actually noticed an odd trend before even using Charles by using the inspect DOM feature of firebug. On the bad request:

http://localhost:5000/Dojo-0.4.1/release/dojo/tests/flash/test_comm_simple.html

two swf files: HelloWorld_version6 and Storage_verison6 are getting embedded in the DOM. Whereas with the good request:

http://localhost:5000/Dojo-0.4.1/tests/flash/test_comm_simple.html

only the HelloWorld_version6 swf gets embedded. Perhaps the javascript is getting tripped up because of the two swfs and can't tell which one its calling into. I've attached a tarball containing the good and bad sessions.

If confusion over the multiple embedded swfs is a problem, it might be beneficial to incorporate other swfs in the unit test.

Changed 13 years ago by guest

Attachment: debugging.tar.gz added

sessions from Charles

comment:7 Changed 12 years ago by alex

Milestone: 0.9M10.9M2

comment:8 Changed 12 years ago by alex

punting to 0.9 final. This isn't a blocker.

comment:9 Changed 12 years ago by alex

Milestone: 0.9beta0.9

comment:10 Changed 12 years ago by alex

Milestone: 0.91.1
Owner: changed from alex to Brad Neuberg
Status: reopenednew

brad, is this still an issue?

comment:11 Changed 12 years ago by Adam Peller

Owner: changed from Brad Neuberg to bradneuberg

comment:12 Changed 12 years ago by bradneuberg

Milestone: 1.11.2

comment:13 Changed 12 years ago by Brad Neuberg

Resolution: fixed
Status: newclosed

(In [13016]) fixes #2523

Note: See TracTickets for help on using tickets.