Project

General

Profile

Bug #622

Updated by Miroslav Blaško almost 6 years ago

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, Please, revise other similar occurrences of such mistake.* mistake. 

 Relevant code within RecordReducer: 
 <pre><code class="javascript"> 
        case ActionConstants.DELETE_RECORD_PENDING: 
             state.recordsDeleting.push(action.key); 
             return { 
                 ...state, 
                 recordDeleted: { 
                     status: ACTION_STATUS.PENDING, 
                     key: action.key 
                 }, 
             }; 
 </code></pre> 

 state.recordsDeleting.push(action.key) call modifies the state.

Back