summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenaud Chaput <renchap@gmail.com>2023-07-28 19:11:58 +0200
committerClaire <claire.github-309c@sitedethib.com>2023-07-31 14:33:14 +0200
commit879b8b69d337476cd450a43e458bd6e6503e130d (patch)
treed1428836cbdb6a2cd1c7fc4fc870c1c5ecd6eecd
parent8018d478abccae540e4fa172d6e2e30e88fbd202 (diff)
Fix missing return values in streaming (#26233)
-rw-r--r--streaming/index.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 816a1e379dc..6e2efcefb42 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -726,7 +726,7 @@ const startWorker = async (workerId) => {
}
// If the payload already contains the `filtered` property, it means
- // that filtering has been applied on the ruby on rails side, as
+ // that filtering has been applied on the ruby on rails side, as
// such, we don't need to construct or apply the filters in streaming:
if (Object.prototype.hasOwnProperty.call(payload, "filtered")) {
transmit(event, payload);
@@ -798,12 +798,12 @@ const startWorker = async (workerId) => {
const filter_results = Object.values(req.cachedFilters).reduce((results, cachedFilter) => {
// Check the filter hasn't expired before applying:
if (cachedFilter.expires_at !== null && cachedFilter.expires_at < now) {
- return;
+ return results;
}
// Just in-case JSDOM fails to find textContent in searchableContent
if (!searchableTextContent) {
- return;
+ return results;
}
const keyword_matches = searchableTextContent.match(cachedFilter.regexp);
@@ -818,6 +818,8 @@ const startWorker = async (workerId) => {
status_matches: null
});
}
+
+ return results;
}, []);
// Send the payload + the FilterResults as the `filtered` property