Skip to content

Commit

Permalink
make sure to not filter client features even if oss
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Dec 19, 2024
1 parent 8e8bfa0 commit 59126e8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ export default class FeatureToggleClientStore

let query = this.db('features')
.modify(FeatureToggleStore.filterByArchived, archived)
.modify(
FeatureToggleStore.filterByProjectsAccessibleByOss,
this.isOss,
)
.leftJoin(
this.db('feature_strategies')
.select('*')
Expand Down
10 changes: 0 additions & 10 deletions src/lib/features/feature-toggle/feature-toggle-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,6 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
: queryBuilder.whereNull('archived_at');
};

static filterByProjectsAccessibleByOss: Knex.QueryCallbackWithArgs = (
queryBuilder: Knex.QueryBuilder,
isOss: boolean,
) => {
if (isOss) {
return queryBuilder.andWhere('project', '=', 'default');
}
return queryBuilder;
};

rowToFeature(row: FeaturesTable): FeatureToggle {
if (!row) {
throw new NotFoundError('No feature flag found');
Expand Down
13 changes: 0 additions & 13 deletions src/test/e2e/api/client/feature-oss.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,3 @@ afterAll(async () => {
await app.destroy();
await db.destroy();
});

describe('OSS downgrade', () => {
test('features created in projects other than default is not visible in client endpoint', async () => {
return app.request
.get('/api/client/features')
.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
expect(res.body.features).toHaveLength(1);
expect(res.body.features[0].name).toBe('my.default.toggle');
});
});
});

0 comments on commit 59126e8

Please sign in to comment.