-
Notifications
You must be signed in to change notification settings - Fork 8
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
Codable for EmailVerification and PasswordReset metadata objects #319
Conversation
Hi @ifabijanovic, thanks for your contribution. |
@ifabijanovic I'm wondering if would be possible for you to add a unit test, even a simple one and we could add more later if needed. |
I will have a look at your unit tests and try to produce one. |
- this causes unit tests using socialIdentity to start failing as it seems that object does not implement Codable - test testMICCancelUserAction also seems to crash with SIGABRT on line 4835
I've implemented |
I suggest you create your own user class (a new one, like |
That does not make sense - you want to make use of existing unit tests when introducing changes and this change found that you have a bug in |
@ifabijanovic I can't reproduce the issue that you are reporting with the I suggest you create your own user class and duplicate the unit tests to cover the |
That's strange that everything passes for you... Anyway I've reverted my original unit test changes and added a new custom user class as you advised. I implemented two unit tests (based off other unit tests) - save one works, but refresh one fails for the custom property. It seems that updating a custom user property on the client side results in correct behaviour, but updating a custom value on the backend is not propagated to the client after calling |
Nice changes! I think |
awesome @ifabijanovic! please let us know, looking forward for your feedback. |
Description
EmailVerification
andPasswordReset
metadata objects which are a part ofUserMetadata
do not have theCodable
protocol implemented. This caused theUser
object to fail to initialize usinginit(from:)
with the following error:Changes
Implemented
Codable
for bothEmailVerification
andPasswordReset
objects. Also updated themapping(map:)
method ofMetadata
as it seems it wasn't passing the correct keys tomap
.Tests
Tested in an app making use of Kinvey user accounts, the above mentioned error is gone, checked that all of the data was correctly parsed and available inside the
User
instance.