Skip to content

Commit

Permalink
chore: make event store accept IUser (#3076)
Browse files Browse the repository at this point in the history
## About the changes
Currently, we need to remember of using the email or else the username
of a user when storing into EventStore, because we don't have
[strictNullChecks](https://www.typescriptlang.org/tsconfig#strictNullChecks),
it's error-prone. Fix for a production issue: #3072

This reuses an existing function that also deals with undefined
  • Loading branch information
Gastón Fournier committed Feb 21, 2023
1 parent 03c3499 commit dc0fe39
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/lib/services/feature-toggle-service.ts
Expand Up @@ -1350,7 +1350,7 @@ class FeatureToggleService {
featureName,
environment,
project: projectId,
createdBy: user.email || user.username,
createdBy: user,
oldVariants: theOldVariants,
newVariants: fixedVariants,
}),
Expand Down Expand Up @@ -1436,7 +1436,7 @@ class FeatureToggleService {
featureName,
environment,
project: projectId,
createdBy: user.email || user.username,
createdBy: user,
oldVariants: oldVariants[environment],
newVariants: fixedVariants,
}),
Expand Down

0 comments on commit dc0fe39

Please sign in to comment.