WP-1284: Manage Account Password Changed Date Incorrect/Missing#1316
WP-1284: Manage Account Password Changed Date Incorrect/Missing#1316happycodemonkey wants to merge 2 commits into
Conversation
…hanged instead of Change Password
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1316 +/- ##
=======================================
Coverage 64.09% 64.09%
=======================================
Files 461 461
Lines 13793 13793
Branches 2750 2751 +1
=======================================
Hits 8841 8841
Misses 4603 4603
Partials 349 349
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
taoteg
left a comment
There was a problem hiding this comment.
Added some ideas to this...
| export const getPasswordStatus = (h) => { | ||
| const passwordChanged = h.filter((entry) => | ||
| entry.comment.includes('Password changed') | ||
| entry.comment.includes('Change Password') |
There was a problem hiding this comment.
In the case where a user maybe doesn't change their password ever... (I think annual AUP update is required, but not sure a password reset is mandated by that process), do we need to handle all possible cases:
- only the
Change passwordblock - both the
Change passwordand thePassword changedblocks - only the
Password changedblock
with the latestChange passwordblock taking precedent?
Or should we ignore the old way and just look for the current Change password structure?
Or maybe look for either bock and take whichever has the most recent timestamp?
Maching against only the comment string seems fragile.
Example (from my profile data):
# What displays now:
{
"status": "Active",
"timestamp": "2022-02-01T17:22:20Z",
"actor": "jgentle",
"comment": "Password changed by user."
},
# What should display:
{
"status": "Active",
"timestamp": "2026-01-20T17:19:38Z",
"actor": "jgentle",
"comment": "Change Password"
},
There was a problem hiding this comment.
These are great questions, I'd love to hear thoughts from a few more folks. Password changes are in fact not mandated hence why my profile was not displaying anything, and I also don't love that this could easily break again at any point, though admittedly it seems no one noticed or cared for quite a while...
There was a problem hiding this comment.
I wonder if we can do a simple regex that searches for any combination of "password" and "change".... 🤔
There was a problem hiding this comment.
@taoteg just pushed up a slightly better solution (imo), let me know what you think.
taoteg
left a comment
There was a problem hiding this comment.
Nice way to handle all cases! Are we sure that the last item in the list will always be the most current? Looks that way in my profile data, so probably good. If we get inconsistencies in the UI after this we can add in a timestamp check, but if its not needed this looks good.
I think the filtering handles that and should continue to work, the only part of it that wasn't working was trying to match against the string. Def something to keep an eye on though. |
Updated string being searched for.
Overview
Password changed dates on the manage accounts page was displaying incorrect dates or not at all due to searching history for a comment containing "Password changed". The password change comment at some point seems to have been updated to "Change Password", making this search pull very old data or none at all.
Changes
Update string from Password changed to Change Password
Testing
UI
Notes