-
-
Notifications
You must be signed in to change notification settings - Fork 658
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: feature not found in project yields 404 #3958
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -11,7 +11,7 @@ export interface IFeatureToggleQuery { | |||
export interface IFeatureToggleStore extends Store<FeatureToggle, string> { | |||
count(query?: Partial<IFeatureToggleQuery>): Promise<number>; | |||
setLastSeen(toggleNames: string[]): Promise<void>; | |||
getProjectId(name: string): Promise<string>; | |||
getProjectId(name: string): Promise<string | 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.
There's a chance that we don't find the project id if the feature does not exist at all
`There's no feature named ${featureName} in project ${projectId} ${ | ||
id === undefined | ||
? '.' | ||
: `, but there's a feature by that name in project "${id}"` |
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.
Not sure if we should provide this information in the API, but I'm just keeping the message closer to the one in the left
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 🙌🏼
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
About the changes
When a feature is not found in a project we should fail with a NotFound error. If the feature belongs to a different project, it should not be a permission issue, because the user might not be aware (lack of permissions/visibility) of that other project, so even in this case the error should be NotFound (this also works if we ever allow the same feature name in different projects)
Fixes #3726