-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [IOPLT-724] Split up the backend status for better handling #6296
base: master
Are you sure you want to change the base?
Conversation
…atus-split-and-reorg
…us-split-and-reorg
…us-split-and-reorg
return state; | ||
}; | ||
|
||
export const backendInfoSelector = (state: GlobalState) => state.backendInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this selector is "a thing of the past" and it is used only in ts/sagas/backendStatus.ts
, should we remove it and refactor the latter to use isBackendServicesStatusOffSelector
and a new deadsCounterSelector
?
@@ -49,8 +49,9 @@ export function* backendStatusWatcherLoop( | |||
backendStatusSaga, | |||
getStatus | |||
); | |||
const currentState: ReturnType<typeof backendServicesStatusSelector> = | |||
yield* select(backendServicesStatusSelector); | |||
const currentState: ReturnType<typeof backendInfoSelector> = yield* select( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on the reducer's file about removing this one in favour of two distinct selectors
@@ -241,7 +241,7 @@ export function* initializeApplicationSaga( | |||
// Since the backend.json is done in parallel with the startup saga, | |||
// we need to synchronize the two tasks, to be sure to have loaded the remote FF | |||
// before using them. | |||
const backendStatus = yield* select(backendStatusSelector); | |||
const backendStatus = yield* select(remoteConfigSelector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename backendStatus
to remoteConfig
?
import { getFullLocale } from "../../utils/locale"; | ||
const SystemOffModal = () => { | ||
const backendStatus = useSelector(backendStatusSelector, _.isEqual); | ||
const backendInfoMessage = useSelector(backendInfoMessageSelector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the _.isEqual
comparison function may change the desired behaviour. Are we sure about this?
Short description
This PR aims to split the
backendStatus
reducer and store section into 4 different reducersList of changes proposed in this pull request
backendStatus
reducerremoteConfig
,sectionStatus
,backendInfo
,statusMessages
reducersHow to test
Anything should work properly as usual after changes.