1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-10 17:53:36 +02:00
unleash.unleash/src/lib/db
Gastón Fournier ed5a7960a5
fix: missing events in the event store (#4335)
## About the changes
We are losing some events because of not having "created by" which is
required by a constraint in the DB. One scenario where this can happen
is with the default user admin, because it doesn't have a username or an
email (unless configured by the administrator).

Our code makes assumptions on the existence of one of these 2 attributes
(e.g.
248118af7c/src/lib/services/user-service.ts (L220-L222)).

Event lost metrics:
![Screenshot from 2023-07-24
14-17-20](https://github.com/Unleash/unleash/assets/455064/9b406ad0-bbcb-4263-98dc-74ddd307a5a2)


## Discussion points
The solution proposed here is falling back to a default value. I've
chosen `"admin"` because it covers one of the use cases, but it can also
be `"system"` mimicking
248118af7c/src/lib/services/user-service.ts (L32)
which is used as a default, or `"unknown"` which is sometimes used as a
default:
248118af7c/src/lib/services/project-service.ts (L57)

Anyway, I believe it's better not to lose the event rather than be
accurate with the "created by" that can be fixed later
2023-07-24 13:04:23 +00:00
..
access-store.ts refactor: clean up deprecated permissions (#4124) 2023-06-30 11:15:11 +01:00
account-store.ts fix: add confirmation to disable password login (#3829) 2023-05-23 15:56:34 +01:00
addon-store.ts OpenAPI: addon operations (#3421) 2023-04-18 10:50:34 +00:00
api-token-store.ts chore: add another migration that remigrates the proper way (#3719) 2023-05-11 15:33:04 +02:00
client-applications-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
client-instance-store.ts Remove timeout from store (#3018) 2023-01-30 12:01:44 +01:00
client-metrics-store-v2.ts fix: variant table deadlocks (#4309) 2023-07-21 11:34:32 +02:00
context-field-store.ts chore: remove context/segment usage flag (#4242) 2023-07-14 13:30:15 +03:00
db-pool.ts feat: add "application_name" as an optional DB option #1170 (#1478) 2022-04-07 20:55:56 +02:00
db.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
environment-store.ts feat: add max order to environments (#3988) 2023-06-15 12:21:35 +03:00
event-store.test.ts feat: add event search endpoint (#1893) 2022-08-09 16:14:50 +02:00
event-store.ts fix: missing events in the event store (#4335) 2023-07-24 13:04:23 +00:00
favorite-features-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
favorite-projects-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
feature-environment-store.ts export queries use order by feature name (#3051) 2023-02-06 15:46:25 +01:00
feature-strategy-store.test.ts feat: Persist strategy variants (#4236) 2023-07-13 16:04:55 +02:00
feature-strategy-store.ts feat: Persist strategy variants (#4236) 2023-07-13 16:04:55 +02:00
feature-tag-store.ts fix: fix bulk removal of tags (#3651) 2023-04-28 14:49:34 +03:00
feature-toggle-client-store.ts feat: client api with proper client segments and strategy variants (#4244) 2023-07-14 13:25:31 +02:00
feature-toggle-store.ts feat(#4205): update potentially stale events (#4270) 2023-07-19 15:20:18 +02:00
feature-type-store.ts feat(#4205): implement configurable lifetimes (#4263) 2023-07-18 09:26:32 +00:00
group-store.ts fix: group cleanup (#4334) 2023-07-24 11:05:55 +02:00
index.ts feat: client api with proper client segments and strategy variants (#4244) 2023-07-14 13:25:31 +02:00
pat-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
project-stats-store.ts refactor: switching to new stats calculations (#3477) 2023-04-10 09:50:39 +02:00
project-store.ts feat: feature creation limit crud together with frontend (#4221) 2023-07-13 14:02:35 +03:00
public-signup-token-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
reset-token-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
role-store.ts feat: custom root roles (#3975) 2023-06-14 14:40:40 +01:00
segment-store.test.ts ux: return better error message if a segment doesn't exist (#4122) 2023-06-30 09:02:24 +00:00
segment-store.ts feat: client api with proper client segments and strategy variants (#4244) 2023-07-14 13:25:31 +02:00
session-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
setting-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
strategy-store.ts feat: add title to strategy (#3510) 2023-04-18 08:59:02 +02:00
tag-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
tag-type-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
transaction.ts feat: oss import (#3123) 2023-02-16 08:08:51 +01:00
user-feedback-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
user-splash-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00
user-store.ts feat: allow every store to participate in transaction (#3016) 2023-01-30 09:02:44 +01:00