reactotron icon indicating copy to clipboard operation
reactotron copied to clipboard

Ajax Response Weird

Open redfluz opened this issue 8 years ago • 11 comments

reactotronweird

Reactotron version :1.15.0 React Native Version :0.553 Reactoron client(js) version : ^1.14.0 ** latest reactotron client 2.0 also dont work.. Empty. platform:mac

** I don't change any code, previously i can see ajax request. I have update all bower also.

redfluz avatar May 06 '18 06:05 redfluz

Reactotron 2 requires the reactotron-react-native@next version because it hasn’t been released yet.

Apparently react-native’s new blob support has changed some stuff. I haven’t seen this in action yet though.

What does the yellow box say?

What does your fetch call look like?

skellock avatar May 06 '18 10:05 skellock

i'm not sure i'm updating anything.. but it kinda disappear now.

Apparently react-native’s new blob support has changed some stuff ? Sorry. I'm kinda not understand. It is react-native introduce new thing again ? I really scare if the create new thing each patches without proper note.

my fetch

async function post(url, params, fileUrl) {
   let securityToken = await AsyncStorage.getItem('securityToken');
   let data = new FormData();
   Object.keys(params).forEach((key) => {
       if (params[key] instanceof Date) {
           data.append(key, value.toISOString())
       } else {
           data.append(key, String(params[key]))
       }
   });
   const fetchOptions = {
       method: 'POST',
       headers: {
           'Accept': 'application/json',
           'securityToken': securityToken ? securityToken : '',
           'UserAgent': os
       },
       body: data,
       timeout: 6 * 1000
   };
   return fetch(url, fetchOptions)
       .then(checkStatus)
       .then(parseJSON)
}

A full gist at code

redfluz avatar May 06 '18 12:05 redfluz

Ya, blob support landed recently (0.53? 0.54?) and with it, changes to the network stack.

I’ll. Have to take a closer look at posts with for data and figure out what changed and how to fix it.

Thx for the code. That makes it much easier.

skellock avatar May 06 '18 19:05 skellock

Blob support landed in beta 4. Please let us know if this is still an issue!

rmevans9 avatar Jun 09 '18 00:06 rmevans9

i will check up later . I will give the respond 👍

redfluz avatar Jun 09 '18 02:06 redfluz

I confirm that it now works as supposed.

working

ecerroni avatar Jun 09 '18 12:06 ecerroni

I'm still having this issue in [email protected]

Testing on real Android device and develop on Windows.

capture

gorvinsky avatar Jul 10 '18 07:07 gorvinsky

@gorvinsky

Indeed you need at least [email protected] to make it work.

ecerroni avatar Jul 10 '18 08:07 ecerroni

@ecerroni After installing [email protected] without modifying the codes, now it can't detect any activity at all.

gorvinsky avatar Jul 10 '18 09:07 gorvinsky

@gorvinsky

Right, I forgot to say that the new v2 beta desktop client is needed as well. You can download it here: https://github.com/infinitered/reactotron/releases

ecerroni avatar Jul 10 '18 10:07 ecerroni

It's working now Thanks a lot @ecerroni

gorvinsky avatar Jul 11 '18 01:07 gorvinsky