Skip to content
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

fix(analytics): 14294 - prevent init of analytics with empty features #409

Conversation

propakov
Copy link
Contributor

https://kontur.fibery.io/Tasks/Task/After-several-updates-the-initial-state-of-the-analytics-panel-becomes-advanced-analytics-14294

Context:
Reason of a bug being created - sometimes Analytics initial state is full though it's short set.
After investigation with @Akiyamka we found that the reason is featureFlags being {} at the moment of defining initialState prop:
initialState={featureFlags[FeatureFlag.ANALYTICS_PANEL] ? 'short' : null}
When initialState prop is null, in useShortPanelState it's 'full'.
const initialState = props?.initialState ?? 'full';
So main line here in fix is

    {Object.keys(featureFlags).length > 0 && (
        <Layout

just to render layout after we have features filled.

  • Line in src/core/app/features.ts is just redundant, appeared after merge, so remove it.
  • fixes in src/core/shared_state/featureFlags.ts don't make a bug, but still incorrect as value out of atom can be mutated, that can lead to bugs

@propakov propakov self-assigned this Jan 24, 2023
@propakov propakov force-pushed the 14327-arrow-in-the-analytics-tab-is-in-the-incorrect-position-at-the-initiate-state branch from 73fc98d to d1f4ce4 Compare January 25, 2023 06:49
Base automatically changed from 14327-arrow-in-the-analytics-tab-is-in-the-incorrect-position-at-the-initiate-state to main January 25, 2023 12:37
@propakov propakov force-pushed the 14294-after-several-updates-the-initial-state-of-the-analytics-panel-becomes-advanced-analytics branch from dd36f0e to 98baa1b Compare January 25, 2023 12:40
@propakov propakov merged commit 98600df into main Jan 25, 2023
@propakov propakov deleted the 14294-after-several-updates-the-initial-state-of-the-analytics-panel-becomes-advanced-analytics branch January 25, 2023 13:39
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.

2 participants