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

Add new Subscribe2 method #94

Merged
merged 5 commits into from
Aug 22, 2023
Merged

Add new Subscribe2 method #94

merged 5 commits into from
Aug 22, 2023

Conversation

neekolas
Copy link
Collaborator

Summary

Our current Subscribe API is limited by the fact that it was built for browser clients. You cannot update subscriptions. To add or remove topics from a subscription, you have to close the existing subscription and create a new one. This is because browsers do not support bidirectional GRPC streaming. With iOS, Android, and Rust native supporting full-fledged GRPC, this limitation doesn't apply.

This PR creates a new SubscribeV2 GRPC service that allows clients to update their subscriptions without disconnecting. These small disconnects are a pain point for apps who rely on streams to get new messages. When using conversations.streamAllMessages these disconnects happen every time a new conversation is started, since the stream needs to include the new conversation topics.

This change has the added benefit of decreasing load on our nodes, since we wouldn't have to tear down and recreate the subscriptions every time a topic is added.

title: "MessageApi";
version: "1.0";
};
info: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why my formatter is different from what was used for this file. We should probably add some vscode config to standardize everyone

@neekolas neekolas marked this pull request as ready for review August 22, 2023 20:38
@neekolas neekolas requested a review from a team as a code owner August 22, 2023 20:38
}
;
}
;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this what the formatter is forcing? This looks terrible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Completely agree. I tried using a different formatter and that one fails the linter. So, I'm kinda stuck.

@neekolas neekolas changed the title Add new SubscribeV2 method Add new Subscribe2 method Aug 22, 2023
@neekolas neekolas merged commit b8a8251 into main Aug 22, 2023
@neekolas neekolas deleted the subscribe-v2 branch August 22, 2023 21:46
@github-actions
Copy link

🎉 This PR is included in version 3.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants