-
13 Oct 2011 1:24 AM #1
localstorage proxy sync error, Batch.js related ?
localstorage proxy sync error, Batch.js related ?
Hi,
I tried to use a localstorage proxy in my project but when I try to sync I have an error :
TypeError: 'undefined' is not an object (evaluating 'me.proxy[operation.action]')
I've seen in the Tweeter example that localstorage seems to be non functional but I explored this error.
This error is sent in Batch.js line 178 :
proxy is indeed undefined.Code:me.proxy[operation.action](operation, onProxyReturn, me);
I explored a bit the Ext.data.Batch class and it seems that the constructor doesn't retain the proxy config object. It calls me.mixins.observable.constructor.call(me, config) to retain the listener but nothing about proxy.
I modified a bit the constructor to retain the proxy and it now seems to work (not completely tested).
Please take in consideration that I am new to Sencha, and it is possible that I do not use the API correctly and that there is actually no bug.Code:constructor: function(config) { var me = this; /** * @event complete * Fired when all operations of this batch have been completed * @param {Ext.data.Batch} batch The batch object * @param {Object} operation The last operation that was executed */ /** * @event exception * Fired when a operation encountered an exception * @param {Ext.data.Batch} batch The batch object * @param {Object} operation The operation that encountered the exception */ /** * @event operationcomplete * Fired when each operation of the batch completes * @param {Ext.data.Batch} batch The batch object * @param {Object} operation The operation that just completed */ me.mixins.observable.constructor.call(me, config); // HACK start sdiprizio (brute force, probably a better/cleaner way to do that) if (config.proxy) this.proxy = config.proxy; // HACK end /** * Ordered array of operations that will be executed by this batch * @property {Ext.data.Operation[]} operations */ me.operations = []; },
I'm also sorry about my poor english.
Regards.
Stephane.
-
13 Oct 2011 7:31 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
There do seem to be some issues with LocalStorage at the moment. Thank you for the report.
-
21 Oct 2011 10:23 AM #3
Thank you for sharing, Stephane! I ran into the same problem and I'm using your workaround for now. - y
-
3 Nov 2011 11:49 AM #4Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
This is because of some changes to Observable that require updates to Batch and a few other classes. We're working through a number of data package updates at the moment, though these will probably not make it into the next public build.
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
8 Nov 2011 5:32 AM #5
-
16 Jan 2012 9:23 AM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
This has been fixed as part of the next Touch 2.0 release. Thanks for the report!
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-862
in
2.0.


Reply With Quote

