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

setTimeout handler is not called #4372

Closed
haggholm opened this issue Nov 29, 2018 · 2 comments
Closed

setTimeout handler is not called #4372

haggholm opened this issue Nov 29, 2018 · 2 comments

Comments

@haggholm
Copy link

Issue Description

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 = new Promise((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; I’m not sure which project this bug should be filed under: RN or RNN? I have a vague suspicion that it might be something like facebook/react-native#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.


Environment

  • React Native Navigation version: 2.1.3, 2.1.3-snapshot.49
  • React Native version: 0.57.7
  • Platform(s) (iOS, Android, or both?): Android, yes; iOS, unknown
  • Device info (Simulator/Device? OS version? Debug/Release?): Multiple devices, multiple emulators with different images
@stale
Copy link

stale bot commented Dec 29, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Dec 29, 2018
@stale
Copy link

stale bot commented Jan 5, 2019

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant