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

fix: check subscription when relay publish message #1212

Merged
merged 6 commits into from
Aug 31, 2024
Merged

Conversation

kaichaosun
Copy link
Contributor

@kaichaosun kaichaosun commented Aug 28, 2024

Description

Relates to: #1207

Changes

  • ...
  • ...

Tests

@kaichaosun kaichaosun merged commit 99d2477 into master Aug 31, 2024
12 checks passed
@kaichaosun kaichaosun deleted the check-subscribe branch August 31, 2024 01:23
@@ -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)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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.

4 participants