Bug #622
closedincorrect implementation of reducer
Start date:
07.05.2018
Due date:
% Done:
0%
Estimated time:
Description
I believe that RecordReducer is not correctly implemented as it modifies state instead of creating new one. This might cause various hard to debug problems (e.g. when trying to debug issues with use of time traveling). No tests failed so it might be good idea to add test failing for breaking such contract.
Please, revise other similar occurrences of such mistake.
Relevant code within RecordReducer:
case ActionConstants.DELETE_RECORD_PENDING:
state.recordsDeleting.push(action.key);
return {
...state,
recordDeleted: {
status: ACTION_STATUS.PENDING,
key: action.key
},
};
state.recordsDeleting.push(action.key) call modifies the state.