Page MenuHomePhabricator

D7932.id26843.diff
No OneTemporary

D7932.id26843.diff

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
@@ -131,15 +131,24 @@
};
} else if (action.type === queueReportsActionType) {
const { reports } = action.payload;
- const filteredReports = [...updatedReports, ...reports].filter(report =>
+ const filteredReports = reports.filter(report =>
isReportEnabled(report, state.enabledReports),
);
+
+ const reportStoreOperations: $ReadOnlyArray<ReportStoreOperation> =
+ convertReportsToReplaceReportOps([...newReports, ...filteredReports]);
+
+ const queuedReports = processReportStoreOperations(
+ state.queuedReports,
+ reportStoreOperations,
+ );
+
return {
reportStore: {
...state,
- queuedReports: filteredReports,
+ queuedReports,
},
- reportStoreOperations: [],
+ reportStoreOperations,
};
}
const reportStore =
diff --git a/lib/reducers/report-store-reducer.test.js b/lib/reducers/report-store-reducer.test.js
--- a/lib/reducers/report-store-reducer.test.js
+++ b/lib/reducers/report-store-reducer.test.js
@@ -208,7 +208,10 @@
const action = {
type: 'QUEUE_REPORTS',
payload: {
- reports: [mockErrorReport],
+ reports: [
+ { ...mockErrorReport, id: 'new-1' },
+ { ...mockInconsistencyReport, id: 'new-2' },
+ ],
},
};
const reportStore = {
@@ -220,8 +223,8 @@
},
};
const { reportStore: result } = reduceReportStore(reportStore, action, [
- mockErrorReport,
- mockInconsistencyReport,
+ { ...mockErrorReport, id: 'new-3' },
+ { ...mockInconsistencyReport, id: 'new-4' },
]);
expect(result.queuedReports).toHaveLength(3);
const enabledReports = result.queuedReports.filter(

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 8:22 AM (18 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694120
Default Alt Text
D7932.id26843.diff (1 KB)

Event Timeline