Results 1 to 8 of 8

Thread: Undocumented breaking change: responseText undefined

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2009
    Location
    Heidelberg, Germany
    Posts
    78

    Default Undocumented breaking change: responseText undefined

    I am not sure whether this qualifies as a bug, but if not, it should be documented, so please accept it as a documentation bug, at least.

    Ext 6.6.0 breaks code that tries to Ext.decode(response.responseText) for a JSON response in an Ajax proxy. This fiddle works in 6.5.3, but causes an exception when run under 6.6.0.

    I backtraced the problem and found:
    • Ext.data.reader.JSON introduces a new private property responseType
    • Ext.data.proxy.Proxy then uses this property to set its own property responseType
    • Ext.data.proxy.Ajax.buidlRequest then uses it to set request.responseType which in turn sets the responseType of the XHR object
    • This causes the XHR object to return parsed json instead of text which causes Ext.data.request.Ajax.createResponse to create a response object that contains responseJson instead of responseText. Any code (event handler) that accesses the response object directly and decodes the json from responseText (as was necessary with 6.5.3) will break with 6.6.0


    I think this should be documented in the Ext 6.6.0 release notes.

    Another documentation bug I discovered along the way: The documentation states in many places (e.g. requestcomplete) that the actual XHR object was passed as an argument which is not true. In fact, a plain javascript object is returned which is created by Ext.data.request.Ajax.createResponse or Ext.data.request.Base.createException.

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006

    Default

    Hi there- Thank you for bringing this to our attention. I have shared this with the support team and someone should be getting back with you soon. Your patience is greatly appreciated.

    Michele

  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542

    Default

    Hello,

    Thank you for contacting Sencha Support!

    There is a Jira ticket already for this issue in our tracker [ EXTJS-27512 ] . There are some changes done in 6.6.0 release and you can find in 6.6.0 release notes.

    Please find the link: https://docs.sencha.com/extjs/6.6.0/...ase_notes.html

    Regards,
    Kumar
    Sencha Support.

  4. #4
    Sencha User
    Join Date
    Jun 2009
    Location
    Heidelberg, Germany
    Posts
    78

    Default

    Just to be absolutely clear: As stated in my initial post, the release notes that your refer to, do not mention the changes to response.reponseText which is exactly the problem I am trying to report.

    Stefan

  5. #5
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542

    Default

    Hello Stefan,

    I have registered this as a separate bug specific to this error with reference Jira EXTJS-28243, will link the ticket for you to receive updates.

    Regards,
    Kumar
    Sencha Support.

  6. #6
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    542

    Default

    Hello,

    Please see the latest update we have received on this bug from the Engineering team -

    "This was changed on purpose. If we have a JSON object, we return that.
    This helps speeding up the process since the user won't need to parse every single text return."

    Regards,
    Kumar
    Sencha Support.

  7. #7
    Sencha Premium Member
    Join Date
    Jul 2014
    Posts
    19

    Default

    I agree changes like this need to be documented. The intention may be good but it causes a huge compatibility issue. Basically it breaks all codes that calls for reponse.responseText.

  8. #8
    Sencha Premium User
    Join Date
    Oct 2015
    Location
    Arvada, CO
    Posts
    75

    Default

    I wanted to share what I ended up doing in hopes it helps others. I see 2 ways of going about this:
    1. Overriding Ext.data.request.Ajax to look at JSON responses and add the responseText as the decoded version... only recommended if you have a ton of Ext.decodes all over the place and don't feel like doing 2
    2. Overriding Ext.data.operation.Operation to include a new method getResponseAsObject, and you use that in all of your callbacks, which means you're in control of how it gets returned, and you have one common method of getting your data, instead of having to decode every single time.

    I like version 2 a lot more. If anyone sees any issues with this, I'd love to hear feedback Example

Similar Threads

  1. Undocumented breaking change
    By alexander.urban in forum Ext JS 6.x Q&A
    Replies: 4
    Last Post: 1 Mar 2016, 4:52 PM
  2. Breaking change in Treegrid
    By bseddon in forum Ext:Bugs
    Replies: 4
    Last Post: 22 Apr 2013, 3:55 AM
  3. Ext.Ajax.request fails with responseText=undefined
    By guys2008 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 20 Nov 2010, 7:56 AM
  4. responseText is undefined
    By cwells in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 14 Oct 2010, 8:06 AM
  5. result.responseText undefined
    By NicoP in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 22 Aug 2008, 7:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •