@@ -156,6 +156,7 @@ const {
156156 loading,
157157 maintenanceCountdownNow,
158158 recentStatusByContainer,
159+ recentStatusByIdentity,
159160 registries,
160161 serverInfo,
161162 watchers,
@@ -190,6 +191,7 @@ const {
190191 hidePinned: computed (() => preferences .containers .filters .hidePinned ),
191192 maintenanceCountdownNow ,
192193 recentStatusByContainer ,
194+ recentStatusByIdentity ,
193195 registries ,
194196 serverInfo ,
195197 watchers ,
@@ -200,22 +202,38 @@ const pendingUpdates = computed(() =>
200202 (row ) =>
201203 row .status === ' pending' &&
202204 ! row .blocked &&
203- ! dashboardUpdateSequence .value .has (getDashboardRecentUpdateRowKey (row )),
205+ ! dashboardUpdateSequence .value .has (getDashboardRecentUpdateSequenceKey (row )),
204206 ),
205207);
206208
207209const displayRecentUpdates = computed <RecentUpdateRow []>(() => {
208- const liveRowKeys = new Set (
209- recentUpdates .value .map ((row ) => getDashboardRecentUpdateRowKey (row )),
210+ const liveRowIdentityKeys = new Set (
211+ recentUpdates .value .map ((row ) => getDashboardRecentUpdateReconciliationKey (row )),
210212 );
211213 const ghosts = [... dashboardPendingUpdateRows .value .values ()]
212- .filter (({ row }) => ! liveRowKeys .has (getDashboardRecentUpdateRowKey (row )))
214+ .filter (({ row }) => ! liveRowIdentityKeys .has (getDashboardRecentUpdateReconciliationKey (row )))
213215 .map (({ row }) => row );
214216 return [... recentUpdates .value , ... ghosts ];
215217});
216218
217- function getDashboardRecentUpdateRowKey(row : Pick <RecentUpdateRow , ' id' | ' name' >): string {
218- return row .id || row .name ;
219+ function getDashboardRecentUpdateSequenceKey(
220+ row : Pick <RecentUpdateRow , ' id' | ' identityKey' | ' name' >,
221+ ): string {
222+ return row .id || row .identityKey || row .name ;
223+ }
224+
225+ function getDashboardRecentUpdateReconciliationKey(
226+ row : Pick <RecentUpdateRow , ' identityKey' | ' id' | ' name' >,
227+ ): string {
228+ return row .identityKey || row .id || row .name ;
229+ }
230+
231+ function getDashboardContainerReconciliationKey(container : {
232+ identityKey? : string ;
233+ id? : string ;
234+ name? : string ;
235+ }): string {
236+ return container .identityKey || container .id || container .name || ' ' ;
219237}
220238
221239function stopDashboardPendingUpdatePolling() {
@@ -233,9 +251,9 @@ function hasDashboardTrackedUpdates() {
233251}
234252
235253function getVisibleDashboardTrackedUpdateKeys() {
236- const keys = new Set (recentUpdates .value .map ((row ) => getDashboardRecentUpdateRowKey (row )));
237- for (const key of dashboardPendingUpdateRows .value .keys ()) {
238- keys .add (key );
254+ const keys = new Set (recentUpdates .value .map ((row ) => getDashboardRecentUpdateSequenceKey (row )));
255+ for (const { row } of dashboardPendingUpdateRows .value .values ()) {
256+ keys .add (getDashboardRecentUpdateSequenceKey ( row ) );
239257 }
240258 return keys ;
241259}
@@ -284,12 +302,14 @@ function clearDashboardPendingUpdateRow(key: string) {
284302}
285303
286304function pruneDashboardPendingUpdateRows(now : number = Date .now ()) {
287- const liveContainerKeys = new Set (
288- containers .value .map ((container ) => container .id || container .name ),
305+ const liveContainerIdentityKeys = new Set (
306+ containers .value
307+ .map ((container ) => getDashboardContainerReconciliationKey (container ))
308+ .filter ((key ) => key .length > 0 ),
289309 );
290310 for (const [key, pendingRow] of dashboardPendingUpdateRows .value .entries ()) {
291311 if (
292- liveContainerKeys .has (key ) ||
312+ liveContainerIdentityKeys .has (key ) ||
293313 now - pendingRow .startedAt > DASHBOARD_PENDING_UPDATE_TIMEOUT_MS
294314 ) {
295315 clearDashboardPendingUpdateRow (key );
@@ -335,12 +355,14 @@ function startDashboardPendingUpdatePolling() {
335355}
336356
337357function capturePendingDashboardRows(rows : RecentUpdateRow []) {
338- const liveContainerKeys = new Set (
339- containers .value .map ((container ) => container .id || container .name ),
358+ const liveContainerIdentityKeys = new Set (
359+ containers .value
360+ .map ((container ) => getDashboardContainerReconciliationKey (container ))
361+ .filter ((key ) => key .length > 0 ),
340362 );
341363 for (const row of rows ) {
342- const key = getDashboardRecentUpdateRowKey (row );
343- if (liveContainerKeys .has (key )) {
364+ const key = getDashboardRecentUpdateReconciliationKey (row );
365+ if (! key || liveContainerIdentityKeys .has (key )) {
344366 continue ;
345367 }
346368 const existing = dashboardPendingUpdateRows .value .get (key );
@@ -453,7 +475,9 @@ function confirmDashboardUpdateAll() {
453475 const pendingRowsSnapshot = pendingUpdates .value .filter ((row ) => ! row .blocked );
454476 dashboardUpdateAllInProgress .value = true ;
455477 dashboardUpdateError .value = null ;
456- const snapshotRowKeys = pendingRowsSnapshot .map ((row ) => getDashboardRecentUpdateRowKey (row ));
478+ const snapshotRowKeys = pendingRowsSnapshot .map ((row ) =>
479+ getDashboardRecentUpdateSequenceKey (row ),
480+ );
457481 const batchId = createContainerUpdateBatchId ();
458482 const queueTotal = pendingRowsSnapshot .length ;
459483 let acceptedRowKeys = [... snapshotRowKeys ];
@@ -479,12 +503,12 @@ function confirmDashboardUpdateAll() {
479503 successfulRows .push (row );
480504 continue ;
481505 }
482- const rowKey = getDashboardRecentUpdateRowKey (row );
506+ const rowKey = getDashboardRecentUpdateSequenceKey (row );
483507 acceptedRowKeys = acceptedRowKeys .filter ((key ) => key !== rowKey );
484508 syncDashboardUpdateSequenceValue (snapshotRowKeys , acceptedRowKeys );
485509 staleRows .push (row );
486510 } catch (e : unknown ) {
487- const rowKey = getDashboardRecentUpdateRowKey (row );
511+ const rowKey = getDashboardRecentUpdateSequenceKey (row );
488512 acceptedRowKeys = acceptedRowKeys .filter ((key ) => key !== rowKey );
489513 syncDashboardUpdateSequenceValue (snapshotRowKeys , acceptedRowKeys );
490514 if (! firstRejectedUpdate ) {
0 commit comments