-
Notifications
You must be signed in to change notification settings - Fork 4
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
Don’t replace existing discontinuity event #246
Open
lawrence-forooghian
wants to merge
1
commit into
main
Choose a base branch
from
CHA-RL4b1-do-not-replace-existing-event
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This also makes implementation explicit about maintaining a queue of
discontinuity
eventsCurrently, chat-js room lifecycle maintain only latest discontinuity event. Was there a reason for it @AndyTWF 🤔
Also, I am not sure whether we should maintain queue of
discontinuity
events, since aim is to let user know that there was adiscontinuity
only once, and in the case of messages feature, they might like to fetch missed messages.For other features, it might not make much sense.
i.e. customers, won't care much about
discontinuity
in the first place 💁♂️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.
I also strongly believe we should avoid exposing too much internal information unless absolutely necessary. Keeping things simple will help customers get the SDK up and running with minimal setup, without introducing unnecessary complexities that could make it harder to understand.
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.
The intention always was that there would be at most one discontinuity event for any given period of discontinuity (i.e. period of the room status not being ATTACHED). The reason for this was so that we don't spam users: ultimately, they need to know that there was a discontinuity (and ideally the reason for it), they don't need to know a play-by-play of all the discontinuities that may occur as part of a retry loop.
So the spec should reflect the idea of "the first discontinuity observed".
Whilst I agree that other features are not as important in terms of discontinuity, we wanted to add the feature so that it was consistent across chat features.
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.
You mean "the first discontinuity observed" or "the latest discontinuity observed"?
Like current chat-js impl. stores "the latest discontinuity observed", this also means we don't need a queue?
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.
So
CHA-RL4a3
would need rephrasing instead ofCHA-RL4b1
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.
chat-js stored the first one observed, whenever a discontinuity trigger comes up it checks if ones already stored first
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.
Btw, I would like to highlight type of
discontinuities
suspended
andattaches
again,ATTACHED
msg will haveresumed
set tofalse
-> RTL2fconnected
but your token/app has restricted msg/sec rate, so it can receive duplicateATTACHED
withRESUME
false and error - msg/sec rate exceeded -> RTL12There 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.
The second point seems to be related to #239.
So, does it really make sense to only store
first
discontinuity observed? Maybe they wouldn't care much about error caused by RTL2f, but if app has some restrictions over publish/subscribe rate, then they would like to know and fix it in the long term.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.
Like the criteria can be, discontinuity
error
can be overridden if the previous+current state isATTACHED
andresumed
is false over the same connection.