Fix missing return values in streaming (#26233)
parent
446821a0dc
commit
3554c52795
|
@ -714,7 +714,7 @@ const startServer = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the payload already contains the `filtered` property, it means
|
// 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:
|
// such, we don't need to construct or apply the filters in streaming:
|
||||||
if (Object.prototype.hasOwnProperty.call(payload, "filtered")) {
|
if (Object.prototype.hasOwnProperty.call(payload, "filtered")) {
|
||||||
transmit(event, payload);
|
transmit(event, payload);
|
||||||
|
@ -786,12 +786,12 @@ const startServer = async () => {
|
||||||
const filter_results = Object.values(req.cachedFilters).reduce((results, cachedFilter) => {
|
const filter_results = Object.values(req.cachedFilters).reduce((results, cachedFilter) => {
|
||||||
// Check the filter hasn't expired before applying:
|
// Check the filter hasn't expired before applying:
|
||||||
if (cachedFilter.expires_at !== null && cachedFilter.expires_at < now) {
|
if (cachedFilter.expires_at !== null && cachedFilter.expires_at < now) {
|
||||||
return;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Just in-case JSDOM fails to find textContent in searchableContent
|
// Just in-case JSDOM fails to find textContent in searchableContent
|
||||||
if (!searchableTextContent) {
|
if (!searchableTextContent) {
|
||||||
return;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyword_matches = searchableTextContent.match(cachedFilter.regexp);
|
const keyword_matches = searchableTextContent.match(cachedFilter.regexp);
|
||||||
|
@ -806,6 +806,8 @@ const startServer = async () => {
|
||||||
status_matches: null
|
status_matches: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Send the payload + the FilterResults as the `filtered` property
|
// Send the payload + the FilterResults as the `filtered` property
|
||||||
|
|
Loading…
Reference in New Issue