Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const createDetectionIndex = async (
const indexExists = await getIndexExists(callCluster, index);
if (indexExists) {
const indexVersion = await getIndexVersion(callCluster, index);
if (indexVersion !== SIGNALS_TEMPLATE_VERSION) {
if ((indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION) {
await callCluster('indices.rollover', { alias: index });
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const readIndexRoute = (router: IRouter) => {
let mappingOutdated: boolean | null = null;
try {
const indexVersion = await getIndexVersion(clusterClient.callAsCurrentUser, index);
mappingOutdated = indexVersion !== SIGNALS_TEMPLATE_VERSION;
mappingOutdated = (indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION;
} catch (err) {
const error = transformError(err);
// Some users may not have the view_index_metadata permission necessary to check the index mapping version
Expand Down