This better makes sure that .group is always > 0 or not "". Existing code starts of with 1 as group id, but that is nowhere defined.
Either protect against that here by lastOperation.group !== undefined or mention that requirement in TrivialOperationRouter.