When downloading packages in VPN and the client machine disconnects from VPN and switches to CEM mode, the codebases are not refreshed, until the agent is manually restarted.
This happens both ways. VPN <-> CEM
Steps to reproduce:
In short: the actual switch from CEM to VPN is done the first time between download attempts and after that package download was started and failed (package is "Invalid").
The second switch was done while the package download was in progress, this caused the download to stop, and the network change event caused SMF to retry the download. The third attempt tried all the possible ways to connect to SMP but failed (package is "Invalid" again). No more network switches after that and SMF was not triggering the download anymore.
The problem is not in the switching itself, but rather why download is not triggered after the fail.
Just FYI: The Agent restart just reset all kinds of counters as in Package Delivery, so in SMF and SMA core, that is why after restart everything is retried again.
ITMS 8.5 RU3 and earlier
This issue has been resolved with our ITMS 8.5 RU4 release. See Fixed Issues