1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: remove archived features from delta (#9088)

Weird thing is that I could not reproduce it locally, but I have a
theory to fix our delta mismatch.

Revisions are added to the delta every second.

This means that in a single revision, you can disable an event, remove a
dependency, and archive it simultaneously. These actions are usually
performed together since archiving an event will inherently disable it,
remove its dependencies, and so on.

Currently, we observe these events happening within the same revision.
However, since we were checking `.updated` last, the event was always
removed from the `removedMap`.

Now, by checking `.removed` last, the archive action will properly
propagate to the revision.
This commit is contained in:
Jaanus Sellin 2025-01-13 14:36:34 +02:00 committed by GitHub
parent 3759b5a75d
commit 86bbe62abe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,14 +53,14 @@ const applyRevision = (first: Revision, last: Revision): Revision => {
]),
);
for (const feature of last.removed) {
updatedMap.delete(feature.name);
}
for (const feature of last.updated) {
removedMap.delete(feature.name);
}
for (const feature of last.removed) {
updatedMap.delete(feature.name);
}
return {
revisionId: last.revisionId,
updated: Array.from(updatedMap.values()),