Skip to content

Conversation

@Kshitij-Katiyar
Copy link
Contributor

@Kshitij-Katiyar Kshitij-Katiyar commented Mar 12, 2025

Summary

Fixed the issue of deletion of a non-existent subscription

Screenshot

Old

Screenshot from 2025-03-12 17-40-00

New

Screenshot from 2025-03-12 17-35-27

Issue link

Fixes #870

@Kshitij-Katiyar Kshitij-Katiyar added the 2: Dev Review Requires review by a core committer label Mar 12, 2025
@Kshitij-Katiyar Kshitij-Katiyar self-assigned this Mar 12, 2025
@Kshitij-Katiyar Kshitij-Katiyar changed the title Fixed issue of deletion of non-existent subscription [MM-870]: Fixed issue of deletion of non-existent subscription Mar 12, 2025
@Kshitij-Katiyar Kshitij-Katiyar changed the base branch from master to project-board-issue-workflow March 25, 2025 09:05
@Kshitij-Katiyar Kshitij-Katiyar requested a review from hanzei as a code owner March 25, 2025 09:05
@Kshitij-Katiyar Kshitij-Katiyar changed the base branch from project-board-issue-workflow to master March 25, 2025 09:05
@Kshitij-Katiyar Kshitij-Katiyar requested a review from hanzei March 27, 2025 10:40
@Yash-Chakerverti Yash-Chakerverti self-requested a review September 15, 2025 11:36
Copy link

@Yash-Chakerverti Yash-Chakerverti left a 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

@abbas-dependable-naqvi abbas-dependable-naqvi requested review from hanzei and removed request for hanzei September 22, 2025 10:36
@wiggin77
Copy link
Member

@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.

Copy link
Contributor

@hanzei hanzei left a 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

Comment on lines +408 to +416
const (
SubscriptionNotFound = iota
SubscriptionAlreadyExists
InternalServerError
)

func NewSubscriptionError(code int, err error) *SubscriptionError {
return &SubscriptionError{Code: code, Error: err}
}
Copy link
Contributor

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.

Copy link
Member

@wiggin77 wiggin77 Sep 23, 2025

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.

ref: golang/go#63602 (comment)

@wiggin77 wiggin77 merged commit 2e4247f into master Sep 23, 2025
11 checks passed
@wiggin77 wiggin77 deleted the MM-870 branch September 23, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core committer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subscription getting deleted for the repositories which do not even exist

7 participants