rn-foreground-service icon indicating copy to clipboard operation
rn-foreground-service copied to clipboard

Method is_running returns true while the service is actually not running

Open sarthakpranesh opened this issue 1 year ago • 0 comments

This is a weird case but I have some interesting findings. At times the is_running method returns true even when the service is no longer running (no notification for the service).

I also exposed the isRunning react method in ForegroundServiceModule and logged the results from both is_running and isRunning. In many scenarios the is_running says true while the isRunning method says false indicating the service is actually not running at that point of time.

Digging a little deeper I found that is_running returns a local variable being set to true/false. Are their any specific cases because of which we are maintaining a local variable to check if service is running or not rather than the isRunning method that actually checks if the service is running?

sarthakpranesh avatar Nov 07 '23 05:11 sarthakpranesh