WhatsAppInbox in whatsapp_inbox.go puts the incoming text messages into
batches, logs the closed batches, and holds the catch-up after each
connection. It owns the wake and failures channels of Run, the limit of
the catch-up, and, under its own mutex, the state of the catch-up and
its timer. The conversion of an event to a batch message goes with it.
WhatsApp keeps the session and the connection. Its event handler gives
each message to the inbox with a WhatsAppLink, and starts and ends the
catch-up there. The state file stays a field of WhatsApp too, because it
also holds the send records, and it has a mutex of its own. The tests of
the batches and the catch-up move to whatsapp_inbox_test.go, and the
helpers that more test files use move to whatsapp_fake_helper_test.go.
The behavior does not change.
Issue:
6f69ca1