react-native-background-task icon indicating copy to clipboard operation
react-native-background-task copied to clipboard

Android: default timeout is set to 30ms instead of 30s

Open wodCZ opened this issue 7 years ago • 3 comments

As per Headless JS documentation, timeout should be provided as a number of miliseconds.

In default configuration, this library sets 30 as timeout parameter, which means 30ms.

Relevant source code lines: index.android.js and RNJob.java.

This typo is very difficult to notice, as it's only visible in logcat: 01-31 16:22:07.293 9869-9869/com.my.app D/BackgroundTask: Returning HeadlessJsTaskConfig, timeout=30 ms

This could be overriden by timeout property in schedule method (setting that to 30000). I'm not sure it this wouldn't break iOS implementation though.

wodCZ avatar Jan 31 '18 16:01 wodCZ

Oops, my mistake, timeout is actually correctly converted to milliseconds, only the log message has typo & shows ms instead of s.

Closing this as it's not worth of an issue, sorry.

wodCZ avatar Jan 31 '18 17:01 wodCZ

No worries, thanks for reporting and the follow up! I'll actually reopen this to remind myself to correct the log message.

jamesisaac avatar Feb 17 '18 18:02 jamesisaac

logs still have 'ms'

vitto-moz avatar Jul 11 '18 15:07 vitto-moz