-
Notifications
You must be signed in to change notification settings - Fork 381
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
Refactor PacketTunnelActor State, decoupling state from ancilliary data #6042
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.
Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
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.
Reviewed 3 of 7 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift
line 26 at r1 (raw file):
*/ func cacheActiveKey(lastKeyRotation: Date?) { // There should be a way to rationalise these two identical functions into one.
Is this comment still valid?
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.
Reviewed 4 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @acb-mv)
Previously, pinkisemils (Emīls Piņķis) wrote…
Good catch. It's not. |
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
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.
Reviewed 7 of 7 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
c32aa0c
to
8e8910d
Compare
This involves:
StateAssociatedData
, which encompasses common fields of the connection data for connected states and blockage data for error statesmutateAssociatedData
, which applies a mutating function to the data, if present, and replacing a lot of case statements with thisConnectionState
andBlockedState
toState.ConnectionData
andState.BlockingData
, for clarity and namespace hygieneState
Èquatable
(within reason), and using equality testing in lieu of keeping track of whether a change was madeThe result: a lot of business logic that acts on/modifies connection/blockage data is now considerably shorter, as it no longer needs to know about what the state is or which states may exist.
This was made in the course of the post-quantum functionality, and merged into that feature branch. This pull request is a backport of this to
main
.This change is