-
Notifications
You must be signed in to change notification settings - Fork 40
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
Feature/no connection serial recovery key #980
Feature/no connection serial recovery key #980
Conversation
…n-serial-recovery-key
229617e
to
1509938
Compare
6461967
to
72992c9
Compare
public RecoveryKeyContext(String connectionKey, long msgSerial, Map<String, String> channelSerials) { | ||
this.connectionKey = connectionKey; | ||
this.msgSerial = msgSerial; | ||
this.channelSerials.putAll(channelSerials); |
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.
Out of curiosity, why do we copy channelSerials
?
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.
General principal of immutability. We have marked channelSerials field as immutable, so it shouldn't get influenced by
changes in external channelserials and should only capture snapshot of serials at the time of creating the instance.
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.
Got you! (one more point to rewrite lib in Kotlin) I personally prefer using analog of guava's ImmutableMap
which just wraps around existing Map
rather than make Map
's copy. But it this particular code probably no harm to copy
Related #974
Related #846
Related #976