-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
ref(distributions): Refactor fetching flags and their suspect scores #89962
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
base: master
Are you sure you want to change the base?
Conversation
refetch: () => void; | ||
} | ||
|
||
export default function useFlagDrawerData({ |
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.
export default function useFlagDrawerData({ | |
export default function useGroupFlagDrawerData({ |
To match file
}, [filteredFlags, orderBy, sortBy]); | ||
|
||
return { | ||
allFlagCount: suspectFlags.length, |
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.
allFlagCount: suspectFlags.length, | |
allGroupFlagCount: suspectFlags.length, |
}); | ||
|
||
// Combine the flag and suspect data into SuspectGroupTag objects | ||
const suspectFlags = useMemo(() => { |
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.
const suspectFlags = useMemo(() => { | |
const allFlagsWithScores = useMemo(() => { |
Or something that's not suspectFlags. When I read suspectFlags, I think tthe highlighted, most suspicious flags.
isError: isSuspectEnabled ? isFlagsError || isSuspectError : isFlagsError, | ||
isPending: isSuspectEnabled ? isFlagsPending || isSuspectPending : isFlagsPending, | ||
refetch: () => { | ||
refetchFlags(); |
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.
Is it useful to include the refetch for scores too?
); | ||
}); | ||
}, [data, search, tagValues]); | ||
// const enableSuspectFlags = organization.features.includes('feature-flag-suspect-flags'); |
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.
Forgot to remove?
I think we can skip checking this FF for the debug UI. It's more for gating the endpoint, which should be enabled internally.
This is in preparation of the new suspect flags table. The new table will call
useFlagDrawerData()
and then show any flags that are over a specific threshold. But that table and all the ui stuff is a bunch of code, so i split this off separately.Once the new table starts calling
useFlagDrawerData
then there'll be two spots that will share the same caches foruseGroupFeatureFlags
anduseGroupSuspectFlagScores
; but all theuseMemo
calls in here will double up the memory footprint; optimizing for sharing code over memory i guess.