Those are inconsistencies not added via action but directly passed from other reducers.
Why they weren't included in the original code?
They were, but in previous code, they're merged with the current state, see here. Here we need to distinguish between new reports and those already in state to generate proper ops. This variable was introduced in D7923.
Makes sense, thanks! I guess it would be less confusing if instead of using something from outside the if, we would achieve reusability by e.g. extracting common logic to a function.
I guess it would be less confusing if instead of using something from outside the if, we would achieve reusability by e.g. extracting common logic to a function.
I am not sure what you mean exactly by extracting common logic to a function and what we will achieve. But if you suggested wrapping everything before if ... else.. to function - this will be removed with last diff connected to refactor, and the only remaining line will be