BCR can potentially be unloaded from memory when the user is in Android's contact picker activity. If this happens, when they return, the coroutines in refreshRules() and addContactRule() may execute at the same time. This does not cause crashes due to MutableStateFlow's compare and set behavior, but does cause weird behavior, like the new contact rule being added to an empty list of rules.
BCR can potentially be unloaded from memory when the user is in Android's contact picker activity. If this happens, when they return, the coroutines in
refreshRules()
andaddContactRule()
may execute at the same time. This does not cause crashes due toMutableStateFlow
's compare and set behavior, but does cause weird behavior, like the new contact rule being added to an empty list of rules.Fixes: #554