Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7562 closed defect (fixed)

[patch][ccla] dojox.flash interface broken

Reported by: Adam Peller Owned by: bradneuberg
Priority: high Milestone: 1.2
Component: Storage/Flash Version: 1.2beta
Keywords: Cc: jcerruti@…
Blocked By: Blocking:

Description

There a few problems in the way the dojox.flash interface has been refactored from dojo 0.4.x. Among other things, the payload that is received on the Flash end of the interface does not exactly match the data sent from the JavaScript? side (i.e.: some strings are escaped). This makes it hard for the development of Flash programs that use this interface because the format of the data received becomes harder to predict. In particular, the dojox.storage.putMultiple implementation on the Flash provider is broken by this.

Furthermore, the way the serialization and deserialization of data sent to and from the Flash interface is not always recoverable with the current approach, as can be seen by running the dojox.flash test cases after applying the provided patch (reproduce_error.diff)

I have included a suggested patch to fix this problem where the serialization code has been simplified a little (probably gaining some performance with this, unmeasured). With this patch, all values passed from the JavaScript? interface are kept exactly in the Flash side and also returned safely to the JavaScript? side, with the single exception of special Unicode value \u0001 (which I hope it is rare enough to be found in any client code). Ideally, not even this exception would exist, but this is already much better than the current state of things.

Attachments (2)

dojox.flash-enconding.reproduce_error.diff (883 bytes) - added by Adam Peller 11 years ago.
patch from Julian Cerruti (IBM)
dojox.flash-enconding.fix.diff (7.3 KB) - added by Adam Peller 11 years ago.
patch from Julian Cerruti (IBM)

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by Adam Peller

patch from Julian Cerruti (IBM)

comment:1 Changed 11 years ago by Adam Peller

Component: DojoxStorage/Flash

Changed 11 years ago by Adam Peller

patch from Julian Cerruti (IBM)

comment:2 Changed 11 years ago by Brad Neuberg

Hi Julian, I've applied the patch. The one thing I removed was the To/From? input form in the Dojo Flash tests, since those happen programmatically. Tested the updated tests on FF 3, IE 7, Google Chrome, and Safari 3 and all pass.

comment:3 Changed 11 years ago by Brad Neuberg

Resolution: fixed
Status: newclosed

(In [15187]) Fixes #7562; also rebuilt Dojo Storage SWF to pickup serialization changes

comment:4 Changed 11 years ago by Brad Neuberg

Version: 1.1.11.2beta

comment:5 Changed 11 years ago by jcerruti

Thanks, Brad. That is very open from you. I think I was using those fields only at the beginning, while trying to find a repeatable error case. The programmatic loop below does cover any tests you can do in the from/to through the forms, so I think your call was a good one. Thanks again!

Note: See TracTickets for help on using tickets.