-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Properly store User Subclass in Storage #978
Conversation
Codecov Report
@@ Coverage Diff @@
## master #978 +/- ##
=======================================
Coverage 91.86% 91.86%
=======================================
Files 54 54
Lines 5086 5086
Branches 1146 1147 +1
=======================================
Hits 4672 4672
Misses 414 414
Continue to review full report at Codecov.
|
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.
see my comment
src/ParseUser.js
Outdated
@@ -869,7 +869,7 @@ const DefaultController = { | |||
updateUserOnDisk(user) { | |||
const path = Storage.generatePath(CURRENT_USER_KEY); | |||
const json = user.toJSON(); | |||
json.className = '_User'; | |||
json.className = user.className || '_User'; |
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.
how about
json.className = this.constructor.name === 'ParseUser' ? '_User' : this.constructor.name;
i think that'll work and then you don't have to worry about setting this.className.
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.
Perfect!
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.
Looks like we have a flaky test. I can't restart the build the button is missing, can you?
Edit: Works now
This is good. When you guys have it merged, I can switch my use case to this and test for a few days. |
@taivo Let me know if any changes can be made to replicate your issue