Wiping the mailbox can cause deadlock
It seems that there is the possibility for a deadlock when a database write is performed while the mailbox starts wiping.
Example:
class DeadlockTest : IntegrationTest() {
@Test
fun test() {
Thread {
db.dropAllTablesAndClose()
}.start()
Thread {
addOwnerToken()
}.start()
}
}