@@ -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