Skip to content

Commit 7ba5f6e

Browse files
committed
fix polling
1 parent 1ab906a commit 7ba5f6e

File tree

1 file changed

+6
-6
lines changed
  • packages/compass-global-writes/src/store

1 file changed

+6
-6
lines changed

packages/compass-global-writes/src/store/reducer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,8 @@ const handleLoadingError = ({
864864
const { status } = getState();
865865
const isPolling = status === ShardingStatuses.SHARDING;
866866
const isInitialLoad = status === ShardingStatuses.NOT_READY;
867-
const errorMessage = `${description} ${error.message}`;
867+
const errorMessage = `${description}: ${error.message}`;
868868
if (isInitialLoad || isPolling) {
869-
if (isPolling) {
870-
dispatch(stopPollingForShardKey());
871-
}
872869
dispatch({
873870
type: GlobalWritesActionTypes.LoadingFailed,
874871
error: errorMessage,
@@ -886,13 +883,16 @@ const handleLoadingError = ({
886883

887884
export const fetchNamespaceShardKey = (): GlobalWritesThunkAction<
888885
Promise<void>,
889-
NamespaceShardingErrorFetchedAction | NamespaceShardKeyFetchedAction
886+
| NamespaceShardingErrorFetchedAction
887+
| NamespaceShardKeyFetchedAction
888+
| NextPollingTimeoutClearedAction
890889
> => {
891890
return async (
892891
dispatch,
893892
getState,
894893
{ atlasGlobalWritesService, logger, connectionInfoRef }
895894
) => {
895+
dispatch({ type: GlobalWritesActionTypes.NextPollingTimeoutCleared });
896896
const { namespace, status, managedNamespace } = getState();
897897

898898
try {
@@ -941,7 +941,7 @@ export const fetchNamespaceShardKey = (): GlobalWritesThunkAction<
941941
handleLoadingError({
942942
error: error as Error,
943943
id: `global-writes-fetch-shard-key-error-${connectionInfoRef.current.id}-${namespace}`,
944-
description: 'Failed to fetch shard key / deployment status',
944+
description: 'Failed to fetch shard key or deployment status',
945945
})
946946
);
947947
}

0 commit comments

Comments
 (0)