Badoo Zsolt Kocsi Aug 8, 2018

MVI Beyond State Reducers: A Modern Kotlin-Based MVI Architecture

Article Summary

Zsolt Kocsi from Bumble reveals how their chat module had bugs so elusive that QA could record them happening but developers could never reproduce them. The culprit? Uncontrolled state management in a massively asynchronous system.

Bumble's Android team faced a critical problem: their rewritten chat module was causing fewer first messages to be sent, hurting business metrics. Even with Clean Architecture, race conditions and unpredictable state changes created bugs that were nearly impossible to debug. This led them to develop MVICore, an open-source MVI framework that goes beyond simple state reducers.

Key Takeaways

Critical Insight

MVICore provides a complete MVI architecture that scales from simple reducers to complex async workflows while keeping all business logic deterministic and debuggable.

The framework includes an IDEA plugin and DebugDrawer module that make implementation surprisingly fast, plus a binding API that connects reactive components with automatic lifecycle handling.

About This Article

Problem

Badoo's chat module had race conditions that were nearly impossible to reproduce. The same sequence of events would only happen occasionally, so bugs that QA caught on video couldn't be reliably triggered again.

Solution

Zsolt Kocsi's team built MVICore, an open-source MVI framework that manages state through immutable State objects and deterministic Reducer transactions. This approach removed the parallel execution callbacks that were causing the problems.

Impact

With MVICore, Badoo could put all business logic into reusable Feature components. The framework included built-in logging and time-travel debugging, so developers could see exactly how state changed without needing to add extra code elsewhere.