Skip to content

Commit

Permalink
refactor: remove deep diff (#5217)
Browse files Browse the repository at this point in the history
For a while we ran a diffing algorithm in production to verify that the
results of the refactor did not differ from the previous results. As the
experiment has run it's course and new attributes have been added on top
of the new flow, this will remove the logging and associated code.
  • Loading branch information
FredrikOseberg authored Oct 30, 2023
1 parent 50ddb36 commit 7d65615
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 181 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"knex": "^2.5.1",
"lodash.get": "^4.4.2",
"lodash.groupby": "^4.6.0",
"lodash.isequal": "^4.5.0",
"lodash.sortby": "^4.7.0",
"log4js": "^6.0.0",
"make-fetch-happen": "^11.0.0",
Expand Down
67 changes: 0 additions & 67 deletions src/lib/features/feature-toggle/deep-diff.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/lib/features/feature-toggle/feature-toggle-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ import { IPrivateProjectChecker } from '../private-project/privateProjectChecker
import { IDependentFeaturesReadModel } from '../dependent-features/dependent-features-read-model-type';
import EventService from '../../services/event-service';
import { DependentFeaturesService } from '../dependent-features/dependent-features-service';
import isEqual from 'lodash.isequal';
import { deepDiff } from './deep-diff';

interface IFeatureContext {
featureName: string;
Expand Down Expand Up @@ -1058,22 +1056,6 @@ class FeatureToggleService {
await this.featureToggleStore.getPlaygroundFeatures(query),
]);

const equal = isEqual(
featuresFromClientStore,
featuresFromFeatureToggleStore,
);

if (!equal) {
const difference = deepDiff(
featuresFromClientStore,
featuresFromFeatureToggleStore,
);
this.logger.warn(
'getPlaygroundFeatures: features from client-feature-toggle-store is not equal to features from feature-toggle-store',
difference,
);
}

const features = this.flagResolver.isEnabled('separateAdminClientApi')
? featuresFromFeatureToggleStore
: featuresFromClientStore;
Expand Down Expand Up @@ -1109,22 +1091,6 @@ class FeatureToggleService {
),
]);

const equal = isEqual(
featuresFromClientStore,
featuresFromFeatureToggleStore,
);

if (!equal) {
const difference = deepDiff(
featuresFromClientStore,
featuresFromFeatureToggleStore,
);
this.logger.warn(
'getFeatureToggles: features from client-feature-toggle-store is not equal to features from feature-toggle-store diff',
difference,
);
}

const features = this.flagResolver.isEnabled('separateAdminClientApi')
? featuresFromFeatureToggleStore
: featuresFromClientStore;
Expand Down
79 changes: 0 additions & 79 deletions src/lib/features/feature-toggle/tests/deep-diff.test.ts

This file was deleted.

0 comments on commit 7d65615

Please sign in to comment.