1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-01 13:47:27 +02:00

chore: remove registerFrontendClient flag ws-swe1 [discard]

This commit is contained in:
Nuno Góis 2025-06-18 14:19:03 +01:00
parent 810890fe67
commit 9ee511fca1
No known key found for this signature in database
GPG Key ID: 71ECC689F1091765
6 changed files with 12 additions and 97 deletions

View File

@ -16,7 +16,6 @@ import WarningAmberRounded from '@mui/icons-material/WarningAmberRounded';
import { TimeAgo } from 'component/common/TimeAgo/TimeAgo'; import { TimeAgo } from 'component/common/TimeAgo/TimeAgo';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { getApplicationIssues } from './ApplicationIssues/ApplicationIssues.tsx'; import { getApplicationIssues } from './ApplicationIssues/ApplicationIssues.tsx';
import { useUiFlag } from 'hooks/useUiFlag';
const StyledTable = styled('table')(({ theme }) => ({ const StyledTable = styled('table')(({ theme }) => ({
fontSize: theme.fontSizes.smallerBody, fontSize: theme.fontSizes.smallerBody,
@ -197,7 +196,6 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
const { elementRef, width } = useElementWidth(); const { elementRef, width } = useElementWidth();
const navigate = useNavigate(); const navigate = useNavigate();
const theme = useTheme(); const theme = useTheme();
const registerFrontendClientEnabled = useUiFlag('registerFrontendClient');
const mode = getApplicationIssues(data); const mode = getApplicationIssues(data);
@ -296,56 +294,14 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
{environment.instanceCount} {environment.instanceCount}
</StyledCell> </StyledCell>
</tr> </tr>
{!registerFrontendClientEnabled ? (
<tr> <tr>
<StyledCell>SDK:</StyledCell> <StyledCell>SDK:</StyledCell>
<StyledCell> <StyledCell>
{environment.sdks.map( {environment.sdks.map((sdk) => (
(sdk) => ( <div key={sdk}>{sdk}</div>
<div key={sdk}> ))}
{sdk}
</div>
),
)}
</StyledCell> </StyledCell>
</tr> </tr>
) : null}
{registerFrontendClientEnabled &&
environment.backendSdks.length > 0 ? (
<tr>
<StyledCell>
Backend SDK:
</StyledCell>
<StyledCell>
{environment.backendSdks.map(
(sdk) => (
<div key={sdk}>
{sdk}
</div>
),
)}
</StyledCell>
</tr>
) : null}
{registerFrontendClientEnabled &&
environment.frontendSdks.length > 0 ? (
<tr>
<StyledCell>
Frontend SDK:
</StyledCell>
<StyledCell>
{environment.frontendSdks.map(
(sdk) => (
<div key={sdk}>
{sdk}
</div>
),
)}
</StyledCell>
</tr>
) : null}
<tr> <tr>
<StyledCell>Last seen:</StyledCell> <StyledCell>Last seen:</StyledCell>

View File

@ -135,21 +135,7 @@ export class FrontendApiService {
ip, ip,
); );
if ( // Frontend client registration has been removed as part of the registerFrontendClient flag removal
metrics.instanceId &&
typeof sdkVersion === 'string' &&
this.flagResolver.isEnabled('registerFrontendClient')
) {
const client = {
appName: metrics.appName,
instanceId: metrics.instanceId,
sdkVersion: sdkVersion,
sdkType: 'frontend' as const,
environment: environment,
projects: this.resolveProject(token),
};
this.services.clientInstanceService.registerFrontendClient(client);
}
} }
private async clientForFrontendApiToken(token: IApiUser): Promise<Unleash> { private async clientForFrontendApiToken(token: IApiUser): Promise<Unleash> {

View File

@ -45,13 +45,7 @@ let services: IUnleashServices;
let destroy: () => Promise<void>; let destroy: () => Promise<void>;
beforeAll(async () => { beforeAll(async () => {
const setup = await getSetup({ const setup = await getSetup();
experimental: {
flags: {
registerFrontendClient: true,
},
},
});
request = setup.request; request = setup.request;
stores = setup.stores; stores = setup.stores;
destroy = setup.destroy; destroy = setup.destroy;

View File

@ -223,24 +223,9 @@ export default class ClientMetricsController extends Controller {
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];
for (const app of applications) { for (const app of applications) {
if ( if (
app.sdkType === 'frontend' && app.sdkType !== 'frontend' ||
typeof app.sdkVersion === 'string' typeof app.sdkVersion !== 'string'
) { ) {
if (
this.flagResolver.isEnabled(
'registerFrontendClient',
)
) {
this.clientInstanceService.registerFrontendClient({
appName: app.appName,
instanceId: app.instanceId,
environment: app.environment,
sdkType: app.sdkType,
sdkVersion: app.sdkVersion,
projects: app.projects,
});
}
} else {
promises.push( promises.push(
this.clientInstanceService.registerBackendClient( this.clientInstanceService.registerBackendClient(
app, app,

View File

@ -55,7 +55,6 @@ export type IFlagKey =
| 'uniqueSdkTracking' | 'uniqueSdkTracking'
| 'consumptionModel' | 'consumptionModel'
| 'edgeObservability' | 'edgeObservability'
| 'registerFrontendClient'
| 'reportUnknownFlags' | 'reportUnknownFlags'
| 'lastSeenBulkQuery' | 'lastSeenBulkQuery'
| 'lifecycleMetrics' | 'lifecycleMetrics'
@ -264,10 +263,6 @@ const flags: IFlags = {
process.env.EXPERIMENTAL_EDGE_OBSERVABILITY, process.env.EXPERIMENTAL_EDGE_OBSERVABILITY,
false, false,
), ),
registerFrontendClient: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_REGISTER_FRONTEND_CLIENT,
false,
),
reportUnknownFlags: parseEnvVarBoolean( reportUnknownFlags: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS, process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS,
false, false,

View File

@ -51,7 +51,6 @@ process.nextTick(async () => {
deltaApi: true, deltaApi: true,
uniqueSdkTracking: true, uniqueSdkTracking: true,
strictSchemaValidation: true, strictSchemaValidation: true,
registerFrontendClient: true,
reportUnknownFlags: true, reportUnknownFlags: true,
customMetrics: true, customMetrics: true,
lifecycleMetrics: true, lifecycleMetrics: true,