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

chore: ignore CR events with feature name (#10503)

## About the changes
This ignores Change Request event types when calculating the etag
because Change Request events don't change data.

They were being included when the change request event contained a
featureName. After this change, those should be excluded.
This commit is contained in:
Gastón Fournier 2025-08-19 05:46:00 -07:00 committed by GitHub
parent 37b716c4ba
commit 32ddf1487b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -203,7 +203,8 @@ export class EventStore implements IEventStore {
.whereNotIn('type', [
FEATURE_CREATED,
FEATURE_TAGGED,
]),
])
.whereNot('type', 'LIKE', 'change-%'),
)
.orWhereIn('type', [
SEGMENT_UPDATED,

View File

@ -6,6 +6,7 @@ import dbInit, { type ITestDb } from '../../helpers/database-init.js';
import getLogger from '../../../fixtures/no-logger.js';
import type User from '../../../../lib/types/user.js';
import { TEST_AUDIT_USER } from '../../../../lib/types/index.js';
import { CHANGE_REQUEST_CREATED } from '../../../../lib/events/index.js';
// import { DEFAULT_ENV } from '../../../../lib/util/constants';
const testUser = { name: 'test', id: -9999 } as User;
@ -139,6 +140,14 @@ describe.each([
TEST_AUDIT_USER,
);
await app.services.eventService.storeEvent({
type: CHANGE_REQUEST_CREATED,
createdBy: testUser.email,
createdByUserId: testUser.id,
ip: '127.0.0.1',
featureName: `ch-on-feature-${apendix}`,
});
shutdownHooks.push(async () => {
await app.destroy();
await db.destroy();