Apps: Improve state handling in case of overflowing session.