-
-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: delta do not return archived as changed #9062
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@sjaanus, core features have been modified in this pull request. Please review carefully! |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
(feature) => | ||
projects.includes('*') || projects.includes(feature.project), | ||
) | ||
.map((feature) => feature.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an actual big bug. We were returning the removed as complex object, but to API it should go as string array.
@@ -197,6 +200,9 @@ export class ClientFeatureToggleDelta { | |||
} | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We needed a way to clear out delta between e2e test runs. We might find a better way in future.
@@ -217,6 +223,7 @@ export class ClientFeatureToggleDelta { | |||
...new Set( | |||
changeEvents | |||
.filter((event) => event.featureName) | |||
.filter((event) => event.type !== 'feature-archived') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change events should not have archived events. These belong to removed.
import { validateSchema } from '../validate'; | ||
import type { ClientFeaturesDeltaSchema } from './client-features-delta-schema'; | ||
|
||
test('clientFeaturesDeltaSchema all fields', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add schema test.
@@ -44,7 +42,7 @@ export class ClientFeatureToggleService { | |||
async getClientDelta( | |||
revisionId: number | undefined, | |||
query: IFeatureToggleQuery, | |||
): Promise<RevisionDeltaEntry | undefined> { | |||
): Promise<ClientFeaturesDeltaSchema | undefined> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the types. RevisionDeltaEntry has removed as complex objects, but we are returning string array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Our delta API was returning archived feature as updated. Now making sure we do not put
archived-feature
event intoupdated
event array.Also stop returning removed as complex object.