You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A piece of our network logic involves a delay to collect WS messages for batch sends. The relevant code looks like this:
if(!currentBatchPromise){logger.debug('Enqueueing new batch promise');currentBatchPromise=newPromise((resolve,reject)=>setTimeout(()=>sendCurrentBatch(resolve,reject),10));}
Most of the time, this works fine. However, sometimes the timeout handler (sendCurrentBatch) is never invoked. Typically, this happens when transitioning between different screens, using react-native-navigation (v2); I’m not sure which project this bug should be filed under. I have a vague suspicion that it might be something like #22089 (“Timers do not run if specified before App mounts”), compounded by the fact that (if I understand correctly) RNN, on some level, creates more than one “app”. I do not know the details.
But it seems very…wrong…that a function like setTimeout can somehow stop working in the middle of a running application.
The text was updated successfully, but these errors were encountered:
I have solved my issue it was a problem with HeadlessJS.
I was starting service in onCreate of Application to keep app alive after destroying, but this essentially kills timers. Starting service in onPause of Activity solves this problem.
Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.
Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗
Environment
Description
A piece of our network logic involves a delay to collect WS messages for batch sends. The relevant code looks like this:
Most of the time, this works fine. However, sometimes the timeout handler (
sendCurrentBatch
) is never invoked. Typically, this happens when transitioning between different screens, usingreact-native-navigation
(v2); I’m not sure which project this bug should be filed under. I have a vague suspicion that it might be something like #22089 (“Timers do not run if specified before App mounts”), compounded by the fact that (if I understand correctly) RNN, on some level, creates more than one “app”. I do not know the details.But it seems very…wrong…that a function like
setTimeout
can somehow stop working in the middle of a running application.The text was updated successfully, but these errors were encountered: