MBIM: wrong transition to 'idle' registration state on access tech change from LTE to 5GNR
The logic to update the per-domain registration state in MBIM uses a single MBIM message to update all CS, PS, EPS and 5GS domains, in that order.
If we're registered in EPS and we receive an indication specifying that we're now registered in 5GS, ModemManager would then clear the EPS registration (and report the modem with a combined registration state of idle) and then right away set the 5GS registration to home (and report the modem with a combined registration state of home).
These state updates in the DBus property are emitted all right away, they're not deferred, so we end up notifying false transitions into 'idle' registration state that never happened, which may confuse clients using that property.
E.g., we're registered in LTE (home) and we get a single notification that we're registered in 5GNR (home) instead:
2022-09-07T19:40:21.086276Z DEBUG ModemManager[2567]: <debug> [modem0] received notification (service 'basic-connect', command 'register-state')
2022-09-07T19:40:21.086307Z DEBUG ModemManager[2567]: <debug> [modem0] processed MBIMEx v2.0 register state indication
// Here we clear the EPS registration state to 'idle'
2022-09-07T19:40:21.086383Z INFO ModemManager[2567]: <info> [modem0] 3GPP registration state changed (home -> idle)
2022-09-07T19:40:21.086407Z DEBUG ModemManager[2567]: <debug> [modem0] consolidated registration state: cs 'idle', ps 'idle', eps 'idle', 5gs 'idle' --> 'idle'
// Here we set the 5GS registration state to 'home'
2022-09-07T19:40:21.086670Z INFO ModemManager[2567]: <info> [modem0] 3GPP registration state changed (idle -> registering)
2022-09-07T19:40:21.087948Z INFO ModemManager[2567]: <info> [modem0] 3GPP registration state changed (registering -> home)
The way to solve and clean this up would be to update all per-domain registration states and only build the final consolidated one once we have all updated, not every time we update each of them.