Read feature flags from cache (#11556)

We are now storing a workspace's feature flag map in our redis cache. 
The cache is invalidated upon feature flag update through the lab
resolver.
This commit is contained in:
Marie
2025-04-14 17:31:13 +02:00
committed by GitHub
parent 15eb96337f
commit d4deca45e8
22 changed files with 323 additions and 248 deletions

View File

@ -5,7 +5,6 @@ export const UPDATE_LAB_PUBLIC_FEATURE_FLAG = gql`
$input: UpdateLabPublicFeatureFlagInput!
) {
updateLabPublicFeatureFlag(input: $input) {
id
key
value
}

View File

@ -2,11 +2,11 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState';
import { useState } from 'react';
import { useRecoilState, useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import {
FeatureFlagKey,
useUpdateLabPublicFeatureFlagMutation,
} from '~/generated/graphql';
import { isDefined } from 'twenty-shared/utils';
export const useLabPublicFeatureFlags = () => {
const [error, setError] = useState<string | null>(null);
@ -28,7 +28,6 @@ export const useLabPublicFeatureFlags = () => {
) ?? []),
{
...updatedFlag,
workspaceId: currentWorkspace.id,
},
],
});

View File

@ -43,10 +43,8 @@ export const USER_QUERY_FRAGMENT = gql`
customUrl
}
featureFlags {
id
key
value
workspaceId
}
metadataVersion
currentBillingSubscription {