-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Auth] Convert *Response classes to structs #14012
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. In a follow-up PR, let's investigate if https://github.com/firebase/firebase-ios-sdk/pull/14012/files#diff-870dc0117add1bfe1fac98e8c6559777840cef238c3c14f22c9a2c0dcfa356f0R254-R308 can be reasonably refactored to set the fields at creation time to avoid the need for AuthRPCResponse.setFields
to be mutating
.
I want to experiment with an alternative approach to #14006 where
AuthBackend
is instead made an actor. One of the first errors I hit when doing so is that theT.Response
types need to beSendable
. Making them structs satisfies that constraint. I'm breaking this up into it's own PR as it's a prereq to exploring an alternative approach to #14006 and will be needed in either approach.One important consideration when doing this is to ensure nothing depends on these new structures having reference semantics, else they may be left referencing an outdated copy. I audited all usages of
AuthBackend.call(request: Request) -> Request.Response
and the returned response was always a locally capturedlet
, so if the response would have been mutated, the response would have been assigned to avar
. Additionally, I would have expected to see something like:self.savedResponse = response
, etc.#no-changelog