Skip to content
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

MF-1630 - Replace old subscriptions with a new one instead of throwing an error #1633

Merged
merged 34 commits into from
Aug 12, 2022

Conversation

AryanGodara
Copy link
Contributor

Signed-off-by: AryanGodara aryangodara03@gmail.com

What does this do?

Replaced old subscriptions instead the pubsub.Subscribe(), instead of returning an alreadySubscribed error

Which issue(s) does this PR fix/relate to?

Resolves #1630

List any changes that modify/break current functionality

N/A

Have you included tests for your changes?

No

Did you document any new/modified functionality?

No

Notes

N/A

…ects

Signed-off-by: aryan <aryangodara03@gmail.com>
@AryanGodara AryanGodara requested a review from a team as a code owner July 26, 2022 04:44
@manuio
Copy link
Contributor

manuio commented Jul 26, 2022

@AryanGodara Can you please check why CI is failling?

@AryanGodara
Copy link
Contributor Author

@AryanGodara Can you please check why CI is failling?

Yes, I'm working on it.
the error is related to sync.mutex. I'm working on it

@AryanGodara AryanGodara marked this pull request as draft July 26, 2022 13:10
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #1633 (d484937) into master (42c003b) will decrease coverage by 0.19%.
The diff coverage is 41.24%.

❗ Current head d484937 differs from pull request most recent head ff6c6ba. Consider uploading reports for the commit ff6c6ba to get more accurate results

@@            Coverage Diff             @@
##           master    #1633      +/-   ##
==========================================
- Coverage   69.16%   68.96%   -0.20%     
==========================================
  Files         138      138              
  Lines       11231    11350     +119     
==========================================
+ Hits         7768     7828      +60     
- Misses       2771     2828      +57     
- Partials      692      694       +2     
Impacted Files Coverage Δ
pkg/sdk/go/sdk.go 78.18% <0.00%> (-2.96%) ⬇️
pkg/sdk/go/users.go 46.77% <0.00%> (-10.09%) ⬇️
users/api/requests.go 38.70% <0.00%> (-11.30%) ⬇️
users/api/responses.go 62.26% <ø> (+18.84%) ⬆️
users/users.go 79.48% <ø> (ø)
users/api/endpoint.go 45.57% <10.00%> (-8.59%) ⬇️
users/postgres/users.go 58.42% <40.00%> (-0.72%) ⬇️
users/api/transport.go 68.22% <53.33%> (-2.68%) ⬇️
users/service.go 65.25% <65.71%> (+1.96%) ⬆️
pkg/messaging/nats/pubsub.go 72.36% <100.00%> (+3.87%) ⬆️
... and 7 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
@dborovcanin dborovcanin marked this pull request as ready for review August 2, 2022 10:10
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AryanGodara This needs to be done for all the supported message brokers (MQTT and RabbitMQ) so that all the implementations match as much as possible.

Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you can see, code in different implementations is repeated - mostly the code that holds the subscriptions. You can consider how we can improve this and prevent code repetition.

pkg/messaging/mqtt/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
pkg/messaging/rabbitmq/pubsub.go Outdated Show resolved Hide resolved
pkg/messaging/mqtt/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
pkg/messaging/mqtt/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
dborovcanin
dborovcanin previously approved these changes Aug 11, 2022
pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This starts to look very good to me now. I can approve this one practically, I'll just wait for a few comments from @dborovcanin and we are ready to merge, I think.

pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the remark in MQTT PubSub is resolved, we're ready.

pkg/messaging/mqtt/pubsub.go Outdated Show resolved Hide resolved
pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
Signed-off-by: aryan <aryangodara03@gmail.com>
pkg/messaging/nats/pubsub.go Outdated Show resolved Hide resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drasko drasko merged commit d9c4704 into absmach:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace old subscriptions with a new one instead of throwing an error
5 participants