-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: support topics sequence page #1463
Conversation
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.
lgtm!
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.
Logic looks good to me. Couple suggestions to avoid null checks in the code, otherwise gtg!
this.getLogger().trace( | ||
`Subscribing to topic with resume_at_topic_sequence_number ${options.subscriptionState.resumeAtTopicSequenceNumber} and sequence_page ${options.subscriptionState.resumeAtTopicSequencePage}` | ||
); |
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.
while testing locally, I noticed the logs coming from the web sdk looked poorly formatted, reverted to using the string interpolation instead
[2024-11-08T18:08:38.251Z] TRACE (Momento: PubsubClient): Issuing publish request; topic: %s, message length: %stopic-web,15
[2024-11-08T18:08:38.436Z] TRACE (Momento: PubsubClient): Received an item on subscription stream; topic: %s; sequence number: %s; sequence page: %stopic-web,3,1731089315
Work towards https://github.com/momentohq/dev-eco-issue-tracker/issues/1059
Updates the topic subscription to take the sequence page into account:
SubscriptionState
so we can reconnect gracefullyTopicDiscontinuity
objectsAs part of this change, had to update the client-protos dependency version as well.
Tested locally to verify both node and web clients gracefully reconnect when wifi is toggled and sequence page is used to resume from the next expected sequence number.
Also tested locally and confirmed that subscribing with an initial (arbitrary) sequence page will cause a discontinuity before getting assigned a new sequence page.
Also had forgotten to export
TopicDiscontinuity
in the web sdk in a previous PR, so that was added here as well.