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:
parent
3759b5a75d
commit
86bbe62abe
@ -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()),
|
||||
|
Loading…
Reference in New Issue
Block a user