Skip to content

Conversation

@johnsimons
Copy link
Member

This PR moves archived and pending retry message count tracking from ConnectionsAndStatsStore to RecoverabilityStore for better separation of concerns. The requiresFullFailureDetails() subscription pattern has been removed - RecoverabilityStore now fetches these counts directly on each refresh. Additionally, refactored RecoverabilityStore refresh function for improved maintainability.

@johnsimons johnsimons self-assigned this Nov 28, 2025
Comment on lines +148 to +149
const [response] = await serviceControlClient.fetchTypedFromServiceControl<FailedMessage>(`errors?status=${status}`);
return parseInt(response.headers.get("Total-Count") ?? "0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [response] = await serviceControlClient.fetchTypedFromServiceControl<FailedMessage>(`errors?status=${status}`);
return parseInt(response.headers.get("Total-Count") ?? "0");
return await serviceControlClient.getErrorMessagesCount(status);

Comment on lines 182 to 183
//Refresh is handled by the autoRefresh setup on the respective views, so doing it here also would cause a double refresh
//await refresh();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is valuable commentary, since I had a refresh here and only removed it when I realised a double refresh was occurring, at which point I needed to investigate the reason why

startDate.value = newStartDate;
[archivedMessageCount.value, pendingRetriesMessageCount.value] = await Promise.all([getErrorMessagesCount(FailedMessageStatus.Archived), getErrorMessagesCount(FailedMessageStatus.RetryIssued)]);

if (!messageStatus) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're now going to have to clear messageStatus on unloading any views. This seems clunky to me, since the archivedMessageCount and pendingRetriesMessageCount have been placed in this store when they have nothing to do with the rest of the data which is loaded by this store.

IMO this is a worse solution than having it in the connectionandstatsstore with the flag to identify whether to bother fetching it or not

const showPendingRetry = window.defaultConfig.showPendingRetry;
const { store: connectionsAndStatsStore } = useConnectionsAndStatsAutoRefresh();
connectionsAndStatsStore.requiresFullFailureDetails();
const { autoRefresh } = useStoreAutoRefresh("recoverabilityStore", useRecoverabilityStore, 5000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this is using useStoreAutoRefresh rather than a singleton version, this will result in two versions of the autorefresh on the recoverability store?

Base automatically changed from monitoring_store to master November 28, 2025 04:23
@johnsimons johnsimons closed this Nov 28, 2025
@johnsimons johnsimons deleted the john/move branch November 28, 2025 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants