Skip to content

Commit 163e40c

Browse files
committed
fix: return index filtering to what it was
1 parent c92237b commit 163e40c

File tree

1 file changed

+4
-36
lines changed

1 file changed

+4
-36
lines changed

packages/compass-indexes/src/modules/regular-indexes.ts

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -239,32 +239,15 @@ export default function reducer(
239239
})
240240
)
241241
);
242-
243242
return {
244243
...state,
245244
indexes: action.indexes,
246245
rollingIndexes: action.rollingIndexes,
246+
// Remove in progress stubs when we got the "real" indexes from one of the
247+
// backends. Keep the error ones around even if the name matches (should
248+
// only be possible in cases of "index with the same name already exists")
247249
inProgressIndexes: state.inProgressIndexes.filter((inProgress) => {
248-
// Always keep indexes with explicit errors
249-
if (inProgress.error) {
250-
return true;
251-
}
252-
253-
// Remove failed indexes (they're done and should be cleaned up)
254-
if (inProgress.status === 'failed') {
255-
return false;
256-
}
257-
258-
// If real index doesn't exist, keep the in-progress one
259-
if (!allIndexNames.has(inProgress.name)) {
260-
return true;
261-
}
262-
263-
// Real index exists - only keep in-progress if it's still actively building
264-
// (status: 'inprogress'). Progress is now tracked through the regular index data
265-
const isActivelyBuilding = inProgress.status === 'inprogress';
266-
267-
return isActivelyBuilding;
250+
return !!inProgress.error || !allIndexNames.has(inProgress.name);
268251
}),
269252
status: FetchStatuses.READY,
270253
};
@@ -338,21 +321,6 @@ export default function reducer(
338321
};
339322
}
340323

341-
if (
342-
isAction<IndexCreationSucceededAction>(
343-
action,
344-
ActionTypes.IndexCreationSucceeded
345-
)
346-
) {
347-
// Remove the completed index from in-progress list
348-
return {
349-
...state,
350-
inProgressIndexes: state.inProgressIndexes.filter(
351-
(x) => x.id !== action.inProgressIndexId
352-
),
353-
};
354-
}
355-
356324
if (
357325
isAction<RollingIndexTimeoutCheckAction>(
358326
action,

0 commit comments

Comments
 (0)