diff --git a/lib/reducers/report-store-reducer.js b/lib/reducers/report-store-reducer.js --- a/lib/reducers/report-store-reducer.js +++ b/lib/reducers/report-store-reducer.js @@ -111,15 +111,23 @@ action.payload ) { const { payload } = action; - const unsentReports = updatedReports.filter( - response => !payload.reports.includes(response), + const sentReports = state.queuedReports.filter(response => + payload.reports.includes(response), ); - if (unsentReports.length === updatedReports.length) { - return { reportStore: state, reportStoreOperations: [] }; - } + + const reportStoreOperations: $ReadOnlyArray = [ + convertReportsToRemoveReportsOperation(sentReports), + ...convertReportsToReplaceReportOps(newReports), + ]; + + const queuedReports = processReportStoreOperations( + state.queuedReports, + reportStoreOperations, + ); + return { - reportStore: { ...state, queuedReports: unsentReports }, - reportStoreOperations: [], + reportStore: { ...state, queuedReports }, + reportStoreOperations, }; } else if (action.type === queueReportsActionType) { const { reports } = action.payload;