-
Notifications
You must be signed in to change notification settings - Fork 47
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: check subscription when relay publish message #1212
Conversation
2798423
to
1e231fc
Compare
@@ -280,12 +280,20 @@ func (w *WakuRelay) Publish(ctx context.Context, message *pb.WakuMessage, opts . | |||
if err != nil { | |||
return pb.MessageHash{}, err | |||
} | |||
_, err = w.subscribeToPubsubTopic(params.pubsubTopic) |
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.
why subscribe only in case pubsubtopic is empty?
shouldn't we return errro in this case as well simliar to line 294
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.
For relay REST API, it supports publish a message without pubsubTopic, this is a quick fix for it.
Not sure if there's a better way for this scenario.
Description
Relates to: #1207
Changes
Tests