Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android locks up / does not get receive all initial data (release version) #33

Closed
RayHughes opened this issue Nov 30, 2023 · 4 comments
Closed

Comments

@RayHughes
Copy link

RayHughes commented Nov 30, 2023

Hello!

My team is having issues with Android locking up when compiled with the release flag (production ready). In most cases, the app freezes and prevents user interaction after receiving the initial data. In other cases only a few list items are rendered (5 out of 30).

We are not having any issues on iOS, this library seems to work exceptionally well on that platform.

We are using this in conjunction with Wundergraph client to interact with our graph infrastructure.

https://github.com/wundergraph/wundergraph/blob/7c56ea68215f3a2d93952b891d80b4de699b901a/packages/sdk/src/client/client.ts#L463

@EmilJunker
Copy link
Contributor

Hi. Sorry but I don't think anyone will be able to help you like this. Please provide more information about what exactly you are doing, including:

  • Does the error only happen in release mode or also in debug mode? That is not clear from your description.

  • Have you tried setting the option debug: true for the SSE connection? Do you get any useful logs?

  • only a few list items are rendered (5 out of 30)

    What does that mean? Are you expecting to receive the list item data via SSE? What does the data look like?

@RayHughes
Copy link
Author

RayHughes commented Nov 30, 2023

Does the error only happen in release mode or also in debug mode? That is not clear from your description.

Yes, its happening when compiled for a production build. We have flipper disabled and using the release flag.

We are actually just started experiencing this issue with iOS after more testing, but believe the operating system is doing a better job of masking the issue. We were using previously another polyfill to handle this but had to switch librarihes as the other is unmaintained and had an underlying issue that caused a crash when coming from background. We did not have this issue there.

Have you tried setting the option debug: true for the SSE connection? Do you get any useful logs?

We will take a look and report back.

What does that mean? Are you expecting to receive the list item data via SSE? What does the data look like?

Yes, we receive a list of a couple hundred items that are only relevant for about 20 seconds at a time. It's sports betting data so the data updates very fast and we need to provide it to our clients in near realtime.

The list is updated via json patch

--

The best way for me to describe it is that the library seems to be hanging on the event and buffering the output. I created an endpoint that delivers SSE of just a timestamp and it seems to be hanging delivering a record or two in some cases.

I think the issue is with XmlHttpRequest as it's not really ideal for network streaming as it caches the whole stream buffer until the connection is closed. In cases with fast updating data like ours this can be catastrophic.

@RayHughes
Copy link
Author

RayHughes commented Nov 30, 2023

@Splicer97
Copy link

More info on XMLHttpRequest Streaming:

https://hpbn.co/xmlhttprequest/#streaming-data-with-xhr

react-native-community/discussions-and-proposals#99 (comment)

You can use react-native-oksse library for android and this library for ios. For me it works perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants