Wow! I can imagine what that took, you are hard core (:
Maybe if you overwrite the polling duration declared on line 19 in src/polling/strategy.ts to a value on the order of 5 seconds (or more) but more than the default value of one second (or similarly change the backoff parameterization on that same line) but within reason of your target ux this would resolve the issue while still providing for change of state feedback? Perhaps this can be customizable field set in the agent itself without hardcoding the modification in future releases of the js agent.
The bootcamp is ending this weekend, and afterwards I was planning on drafting a custom hook for use in React projects so I just wanted to say thanks for covering some of the ground work of getting things functional in React Native. Seems like while personal computers are great and all, things need to have mobile representation to be adopted in the way we hope they can be.
The only place I’ve ever encountered an issue with that polling logic in agent-js is when I use it in Android HeadlessJS mode, since setTimeout does NOT work as expected… I’m not sure where you’re making these calls?
Seeing that the poll interval is ~ 1-2 seconds and the fact React Native, as others have said is single-threaded, if the UI thread (that single thread) is polling at 1-2 seconds until the write call finishes this would also explain the laggy, unresponsiveness. Curious though that call never “releases”.
Instead of omitting the call, maybe changing the hard-coded numbers (or making them configurable in future agent-js releases) to something on the order of 5-10 seconds could be a possible if pragmatic solution?