binaryminds / react-native-sse

Event Source implementation for React Native. Server-Sent Events (SSE) for iOS and Android 🚀
https://www.npmjs.com/package/react-native-sse
MIT License
202 stars 30 forks source link

POST method is not receiving data on android and keeps on LOADING state #35

Closed omarDtp closed 9 months ago

omarDtp commented 9 months ago

I installed react-native-sse and i am using it with method POST it works well on iOS but on android it doesnt load any data when the method is POST while it works fine in GET i disabled the Flipper interceptor in debug and its able to establish a connection ( connection opened) but not recieving any message or other events

react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 "react-native-sse": "1.2.0",

EmilJunker commented 9 months ago

It would be helpful if you could share logs from both iOS and for Android for POST and GET methods so we can compare what is happening. To get logs from react-native-sse, set debug: true in EventSource options parameter.

omarDtp commented 9 months ago

Resolved the issue with SSE not working with the POST method. The problem stemmed from a performance bottleneck caused by parsing large data with JSON.parse on the Hermes engine, resulting in slower performance compared to the JSC engine.

To address this, we optimized the size of the object being sent via the server, significantly improving performance. Now, we can successfully retrieve data using the POST method.

Thanks for your swift response and support! @EmilJunker

ngdbao commented 1 week ago

Honestly, this issue should not be closed like this