Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1509 in a recent build.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    49
    Vote Rating
    0
    j.k is on a distinguished road

      0  

    Default PR4: XML loading BROKEN

    PR4: XML loading BROKEN


    I'm not even going to go into details here, but one of the most basic and critical parts in ST, loading XML files via ajax, is now completely broken.

    Part of the problem is the Ajax Proxy's extractResponseData, but after fixing that it still doesn't work and I didn't care to investigate further at this hour.

    I'm sorry if this sounds a bit pissed, but I just spent over an hour fixing and fitting my PR3 app so it will work with PR4 just to see it fail with something like this, which one would expect to have been caught by even the tiniest bit of QA or Unit Testing.

    A timely update or a quick fix to make this work would be highly appreciated, surely not only by me.

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This will be fixed in a timely manner.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    125
    Vote Rating
    0
    oddz is on a distinguished road

      0  

    Default


    What is meant by completely broken? The chrome console is showing an error after wards that the method getSuccess is undefined for me inside Ext.define.Process.

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    125
    Vote Rating
    0
    oddz is on a distinguished road

      0  

    Default


    I did some partial debugging on this and this is what I discovered.

    Ext.data.reader.Xml::extractData() expects a response object. However, Ext.data.proxy.Ajax::extractResponseData() returns the responseText rather than the raw response object. This is due to responseText being the XML string. So with that I created a override for Ext.data.proxy.Ajax::extractResponseData data like so.

    Code:
        /**
         * An Ajax proxy knows its dealing with an XMLHttpRequest so return the responseText property from it
         * @protected
         * @param {XMLHttpRequest} response The server response
         * @return {String} The response text to be used by the reader
         */
        extractResponseData: function(response) {
            if (response && response.responseText && !response.responseXML) {
                return response.responseText;
            }
            return response;
        }
    However, now I am running into issues with an uncaught error being emitted from Ext.data.reader.Xml::extractData. So who knows...

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    125
    Vote Rating
    0
    oddz is on a distinguished road

      0  

    Default


    Here is the other piece to the puzzle. Ext.data.reader.Xml::record does exist. Instead it has been moved into the config. However, the magical getter and setters do not work either. So the only thing to do is hack the core with the below fix (right below the commented code). I may be incorrect int hat you have to hack the core. However, I am not aware of a method to call a super method that is two parents up. You would need to make sure that you call the parent of Ext.data.reader.Xml without calling Ext.data.reader.Xml::extractData in order to use an override.

    Code:
        /**
         * @private
         * We're just preparing the data for the superclass by pulling out the record nodes we want
         * @param {XMLElement} root The XML root node
         * @return {Ext.data.Model[]} The records
         */
        extractData: function(root) {
            
            //var recordName = this.record;
            var recordName = this.config.record;
    
            if (!recordName) {
                Ext.Error.raise('Record is a required parameter');
            }
    
            if (recordName != root.nodeName) {
                root = Ext.DomQuery.select(recordName, root);
            } else {
                root = [root];
            }
            return this.callParent([root]);
        },

  6. #6
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This has been fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha User
    Join Date
    Jan 2012
    Posts
    36
    Vote Rating
    0
    benben is on a distinguished road

      0  

    Default


    Quote Originally Posted by j.k View Post
    I'm sorry if this sounds a bit pissed, but I just spent over an hour fixing and fitting my PR3 app so it will work with PR4 just to see it fail with something like this, which one would expect to have been caught by even the tiniest bit of QA or Unit Testing.
    Completely agree on that one. After reading (and writing) a few bug reports about PR4, it really striked me : Sencha Touch clearly doesn't have up-to-date unit testing even on core features. That scares me a lot. I started to really wonder what's the value of doing bug reports in that context.

  8. #8
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    We knew about this issue and it just didn't make it into the release notes. This release had quite a bit of change that we wanted to get out to people as soon as possible. We plan on getting releases out much more quickly at this stage.

    Sencha Inc

    Jamie Avins

    @jamieavins

  9. #9
    Sencha User
    Join Date
    Jan 2012
    Posts
    36
    Vote Rating
    0
    benben is on a distinguished road

      0  

    Default


    Could you just confirm that you're updating basic unit tests on new features BEFORE publishing anything ?

    This posts mentions a bug in basic XML loading, and i've just submitted one about basic JSON saving. It seems a lot to me like you're forgetting that javascript is NOT a compiled language. Clicking "save" clearly isn't enough.

    (sorry for the tone of that message, but i've just spent another day moving from PR3 to PR4 because of bugs in PR4).

    I understand that it's just a "developer preview", but I feel there's a bit of a contradiction between saying "it's just a developper preview, so don't expect it to work, and don't rely on it, everything could change" on one hand, and the way everything is organized on the website, to make you feel like the version 2 is almost there, including "hey, please post bug reports on that forum".

  10. #10
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Paris, France
    Posts
    187
    Vote Rating
    3
    olouvignes is on a distinguished road

      0  

    Default


    Totally agree, this is just a nightmare for us, once again, i'd love to write jasmine-like unit tests on specific features that my apps rely on to be sure these are never broken, but i just can't. Please give us daily-snapshots & pull-requests!

    These regressions make a lot of people waste a lot of time debugging basic APIs.

    Why not picking a few external testers that have pretty complicated apps with ST2.0 (i do have a 50-class app, that is pretty stable on PR3 with a patched core), these early testers could rush test (like 24h before) a pre-release & give you tips/feedback on basic regressions, etc. You could then spend a couple of days on theses & everyone would be happier... I'd love to do that to help you, since i actually do spend this time anyway debugging the core after the release (with a few hundred other people doing the same thing).