diff --git a/src/redux/reducers/experimentalFeaturesSlice.ts b/src/redux/reducers/experimentalFeaturesSlice.ts index d52b327fe5..7f608fddd0 100644 --- a/src/redux/reducers/experimentalFeaturesSlice.ts +++ b/src/redux/reducers/experimentalFeaturesSlice.ts @@ -2,10 +2,12 @@ import { createSlice } from '@reduxjs/toolkit' import { RootState } from 'src/redux/Store' type ExperimentalFeaturesSlice = { + optOutOfEarlyUserRelease?: boolean unavailableInstitutions?: { guid: string; name: string }[] } export const initialState: ExperimentalFeaturesSlice = { + optOutOfEarlyUserRelease: false, unavailableInstitutions: [], } @@ -15,6 +17,7 @@ const experimentalFeaturesSlice = createSlice({ reducers: { loadExperimentalFeatures(state, action) { state.unavailableInstitutions = action.payload?.unavailableInstitutions || [] + state.optOutOfEarlyUserRelease = action.payload?.optOutOfEarlyUserRelease || false }, }, }) diff --git a/src/utilities/__tests__/pollers-test.js b/src/utilities/__tests__/pollers-test.js index a862aadc5b..4f489bbb12 100644 --- a/src/utilities/__tests__/pollers-test.js +++ b/src/utilities/__tests__/pollers-test.js @@ -249,7 +249,7 @@ describe('pollMember', () => { expect(result.initialDataReady).toBe(true) }) - it('should NOT set initialDataReady flag when async_account_data_ready becomes true and CLT guid is excluded', async () => { + it('should NOT set initialDataReady flag when async_account_data_ready becomes true and optOutOfEarlyUserRelease is true', async () => { const mockMember = createMockMember({ connection_status: ReadableStatuses.SYNCING, is_being_aggregated: false, @@ -260,12 +260,7 @@ describe('pollMember', () => { mockApi.loadJob.mockReturnValue(of(mockJob)) const resultPromise = new Promise((resolve, reject) => { - const subscription = pollMember( - memberGuid, - mockApi, - clientLocale, - 'CLT-64ff7421-a8ef-4ac0-90f1-1636eda1a1fd', - ) + const subscription = pollMember(memberGuid, mockApi, clientLocale, true) .pipe(take(1)) .subscribe({ next: (result) => { diff --git a/src/utilities/pollers.js b/src/utilities/pollers.js index de9a56f067..97fd8a449d 100644 --- a/src/utilities/pollers.js +++ b/src/utilities/pollers.js @@ -26,7 +26,7 @@ export const DEFAULT_POLLING_STATE = { initialDataReady: false, // whether the initial data ready event has been sent } -export function pollMember(memberGuid, api, clientLocale, clientGuid = null) { +export function pollMember(memberGuid, api, clientLocale, optOutOfEarlyUserRelease = false) { return interval(3000).pipe( switchMap(() => // Poll the currentMember. Catch errors but don't handle it here @@ -57,13 +57,11 @@ export function pollMember(memberGuid, api, clientLocale, clientGuid = null) { initialDataReady: acc.initialDataReady, } - // HARD CODED - GROSS... Remove client exclusion when we know how to handle it properly - const excludedClients = ['CLT-64ff7421-a8ef-4ac0-90f1-1636eda1a1fd'] if ( !isError && !acc.initialDataReady && response?.job?.async_account_data_ready && - !excludedClients.includes(clientGuid) + !optOutOfEarlyUserRelease ) { pollingState.initialDataReady = true } diff --git a/src/views/connecting/Connecting.js b/src/views/connecting/Connecting.js index ec07e1b3b7..974e8a8312 100644 --- a/src/views/connecting/Connecting.js +++ b/src/views/connecting/Connecting.js @@ -48,7 +48,7 @@ import { POST_MESSAGES } from 'src/const/postMessages' import { AnalyticContext } from 'src/Connect' import { PostMessageContext } from 'src/ConnectWidget' import { Stack } from '@mui/material' -import { getClientGuid } from 'src/redux/reducers/profilesSlice' +import { getExperimentalFeatures } from 'src/redux/reducers/experimentalFeaturesSlice' export const Connecting = (props) => { const { @@ -61,7 +61,7 @@ export const Connecting = (props) => { } = props const selectedInstitution = useSelector(getSelectedInstitution) - const clientGuid = useSelector(getClientGuid) + const { optOutOfEarlyUserRelease } = useSelector(getExperimentalFeatures) const sendAnalyticsEvent = useAnalyticsEvent() const clientLocale = useMemo(() => { return document.querySelector('html')?.getAttribute('lang') || 'en' @@ -283,7 +283,7 @@ export const Connecting = (props) => { }) .pipe( concatMap((member) => - pollMember(member.guid, api, clientLocale, clientGuid).pipe( + pollMember(member.guid, api, clientLocale, optOutOfEarlyUserRelease).pipe( tap((pollingState) => handleMemberPoll(pollingState)), filter((pollingState) => pollingState.pollingIsDone), pluck('currentResponse'), diff --git a/typings/connectProps.d.ts b/typings/connectProps.d.ts index 4aead1125a..01af22ace1 100644 --- a/typings/connectProps.d.ts +++ b/typings/connectProps.d.ts @@ -38,6 +38,7 @@ interface ConnectProps { userFeatures?: object experimentalFeatures?: null | { unavailableInstitutions?: { guid: string; name: string }[] + optOutOfEarlyUserRelease?: boolean } } interface ClientConfigType {