mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +02:00
chore(AI): debugEtag flag cleanup (#10558)
This PR cleans up the debugEtag flag. These changes were automatically generated by AI and should be reviewed carefully. Fixes #10557 ## 🧹 AI Flag Cleanup Summary This removes the `debugEtag` feature flag from the codebase. This flag was used to enable additional logging for debugging ETag generation for the client features endpoint. ### 🚮 Removed - **Flag Definition** - The `debugEtag` flag from the `IFlagKey` type in `src/lib/types/experimental.ts`. - **Conditional Logging** - Removed logging statements guarded by the `debugEtag` flag in `client-feature-toggle.controller.ts` and `configuration-revision-service.ts`. ### 🛠 Kept - **Default Behavior** - The existing code paths for when the flag was disabled, which is now the only behavior. ### 📝 Why The `debugEtag` flag was marked as completed with the outcome "discarded". The debugging functionality it provided is no longer needed. This change removes the dead code associated with the flag, simplifying the codebase. Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
This commit is contained in:
parent
b8521121a1
commit
fa7857dff1
@ -165,11 +165,6 @@ export default class FeatureController extends Controller {
|
||||
private async resolveFeaturesAndSegments(
|
||||
query?: IFeatureToggleQuery,
|
||||
): Promise<[FeatureConfigurationClient[], IClientSegment[]]> {
|
||||
if (this.flagResolver.isEnabled('debugEtag')) {
|
||||
this.logger.info(
|
||||
`[etag] Flags and segments cache miss for ${JSON.stringify(query)}`,
|
||||
);
|
||||
}
|
||||
if (this.flagResolver.isEnabled('deltaApi')) {
|
||||
const features =
|
||||
await this.clientFeatureToggleService.getClientFeatures(query);
|
||||
@ -326,12 +321,6 @@ export default class FeatureController extends Controller {
|
||||
res.getHeaderNames().forEach((header) => res.removeHeader(header));
|
||||
res.end();
|
||||
return;
|
||||
} else {
|
||||
if (this.flagResolver.isEnabled('debugEtag')) {
|
||||
this.logger.info(
|
||||
`[etag] Provided revision: ${userVersion}, calculated revision: ${etag}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const [features, segments] = await this.featuresAndSegments(
|
||||
@ -369,13 +358,6 @@ export default class FeatureController extends Controller {
|
||||
);
|
||||
|
||||
const queryHash = hashSum(query);
|
||||
if (this.flagResolver.isEnabled('debugEtag')) {
|
||||
this.logger.info(
|
||||
`[etag] for query ${JSON.stringify(
|
||||
query,
|
||||
)} is "${queryHash}:${revisionId}" query by env enabled? ${etagByEnvEnabled ? 'yes' : 'no'}. Querying with env ${etagByEnvEnabled ? query.environment : undefined})`,
|
||||
);
|
||||
}
|
||||
const etagVariant = this.flagResolver.getVariant('etagVariant');
|
||||
if (etagVariant.feature_enabled && etagVariant.enabled) {
|
||||
const etag = `"${queryHash}:${revisionId}:${etagVariant.name}"`;
|
||||
|
@ -77,11 +77,6 @@ export default class ConfigurationRevisionService extends EventEmitter {
|
||||
maxRevId,
|
||||
environment,
|
||||
);
|
||||
if (this.flagResolver.isEnabled('debugEtag')) {
|
||||
this.logger.info(
|
||||
`[etag] Computed ETag for environment ${environment}: ${actualMax} previous was ${maxRevId}`,
|
||||
);
|
||||
}
|
||||
if (maxRevId < actualMax) {
|
||||
this.maxRevisionId.set(environment, actualMax);
|
||||
maxRevId = actualMax;
|
||||
|
@ -60,8 +60,7 @@ export type IFlagKey =
|
||||
| 'addConfiguration'
|
||||
| 'filterFlagsToArchive'
|
||||
| 'fetchMode'
|
||||
| 'etagByEnv'
|
||||
| 'debugEtag';
|
||||
| 'etagByEnv';
|
||||
|
||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user