-
Notifications
You must be signed in to change notification settings - Fork 163
[MM-870]: Fixed issue of deletion of non-existent subscription #886
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
Conversation
webapp/src/components/modals/create_issue/__snapshots__/create_issue.test.jsx.snap
Outdated
Show resolved
Hide resolved
Yash-Chakerverti
left a comment
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 PR is tested & all the code changes are working fine.
LGTM
|
@hanzei we need to merge this to fix a bug. There is a ticket to add the tests, which has been our process to deal with the fact that MM released these plugins with next to no test coverage at all. The coverage has much improved as the tickets do get worked on. |
hanzei
left a comment
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.
One non blocking suggestion
| const ( | ||
| SubscriptionNotFound = iota | ||
| SubscriptionAlreadyExists | ||
| InternalServerError | ||
| ) | ||
|
|
||
| func NewSubscriptionError(code int, err error) *SubscriptionError { | ||
| return &SubscriptionError{Code: code, Error: err} | ||
| } |
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.
2/5 I prefer using customer error variables and then checking them using errors.Is. That is what the std lib recommends and is also used on the MM server.
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.
The Go devs think typed errors are better than sentinel errors. The reason they are not changed in the std lib are for compatibility. Also sentinel errors are much slower.
One thing I aways disliked about sentinel errors is that code could replace the error var with something else. MM server is a mix of sentinel and typed errors.
Summary
Fixed the issue of deletion of a non-existent subscription
Screenshot
Old
New
Issue link
Fixes #870