You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
user.expensifyNewsStatus is overwritten on page reload #3569
@Jag96
It seems the backend is not saving the changes it's returning 0 account: Object { subscribed: 0 } on User.getUserDetails();
So when we toggle it we send the request to the backend, here if the code is 200 we set expensifyNewsStatus to true. But when we refresh User.getUserDetails(); returns 0.
@parasharrajat good find! For context, after looking into this it seems that on the API side we've updated the value of subscribed to be an int rather than a boolean, and it wasn't updated in this codebase. I've created a PR on the API side to fix the issue so that the subscribed value works when sent as a boolean or integer.
It looks like there's still an issue here where the value is being stored as an integer (prop warning), so this issue can remain and the fix can be to update the value that is stored in Onyx so it is a boolean rather than an integer.
checkPropTypes.js:20 Warning: Failed prop type: Invalid prop `user.expensifyNewsStatus` of type `number` supplied to `PreferencesPage`, expected `boolean`.
in PreferencesPage
changed the title [-]user.expensifyNewsStatus is overwritten on page reload[/-][+][HOLD for payment June 28th] user.expensifyNewsStatus is overwritten on page reload[/+]on Jun 22, 2021
I think this is fine to pay out now since its a very small change, it's been merged for 7 days, and I just confirmed it's working properly on staging. Paid!
changed the title [-][HOLD for payment June 28th] user.expensifyNewsStatus is overwritten on page reload[/-][+]user.expensifyNewsStatus is overwritten on page reload[/+]on Jun 29, 2021
Activity
MelvinBot commentedon Jun 12, 2021
Triggered auto assignment to @michaelhaxhiu (
AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.MelvinBot commentedon Jun 15, 2021
Triggered auto assignment to @Jag96 (
Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.michaelhaxhiu commentedon Jun 15, 2021
Posted on Upwork here - https://www.upwork.com/jobs/~01984a0737ed8ba518.
parasharrajat commentedon Jun 15, 2021
@Jag96
It seems the backend is not saving the changes it's returning 0
account: Object { subscribed: 0 }on User.getUserDetails();So when we toggle it we send the request to the backend, here if the code is
200we setexpensifyNewsStatustotrue. But when we refreshUser.getUserDetails();returns 0.Jag96 commentedon Jun 16, 2021
@parasharrajat good find! For context, after looking into this it seems that on the API side we've updated the value of
subscribedto be an int rather than a boolean, and it wasn't updated in this codebase. I've created a PR on the API side to fix the issue so that thesubscribedvalue works when sent as a boolean or integer.It looks like there's still an issue here where the value is being stored as an integer (prop warning), so this issue can remain and the fix can be to update the value that is stored in Onyx so it is a boolean rather than an integer.
cc @jasperhuangg since you're reviewing the API PR
parasharrajat commentedon Jun 16, 2021
I agree @Jag96. Please let me know when the PR is merged for the backend. Thanks.
roryabraham commentedon Jun 17, 2021
The API change has been deployed to production.
parasharrajat commentedon Jun 20, 2021
@Jag96 If this is still available for external. Then we just need to convert the Integer from API response to boolean before saving it to Onyx.
https://github.com/Expensify/Expensify.cash/blob/408b7e00cf33c16600af0b67b819c764fcb5388a/src/libs/actions/User.js#L72
TO
michaelhaxhiu commentedon Jun 21, 2021
@parasharrajat yep it's still available for external. I'll let @Jag96 review your proposal here as the best next step
Jag96 commentedon Jun 22, 2021
@parasharrajat that solution sounds good to me! I've invited you to the Upwork job, once you accept feel free to create a PR.
parasharrajat commentedon Jun 22, 2021
PR is up here #3717
[-]user.expensifyNewsStatus is overwritten on page reload[/-][+][HOLD for payment June 28th] user.expensifyNewsStatus is overwritten on page reload[/+]Jag96 commentedon Jun 22, 2021
Reopening to keep track of payment hold time
michaelhaxhiu commentedon Jun 28, 2021
@Jag96 are we good to pay this today or do we want to wait for the latest PR to hit production? It's on staging right now #3717
Jag96 commentedon Jun 29, 2021
I think this is fine to pay out now since its a very small change, it's been merged for 7 days, and I just confirmed it's working properly on staging. Paid!
[-][HOLD for payment June 28th] user.expensifyNewsStatus is overwritten on page reload[/-][+]user.expensifyNewsStatus is overwritten on page reload[/+]