Skip to content

WP-1284: Manage Account Password Changed Date Incorrect/Missing#1316

Open
happycodemonkey wants to merge 2 commits into
mainfrom
wp-1284/change-password-date
Open

WP-1284: Manage Account Password Changed Date Incorrect/Missing#1316
happycodemonkey wants to merge 2 commits into
mainfrom
wp-1284/change-password-date

Conversation

@happycodemonkey

Copy link
Copy Markdown
Member

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

  1. Navigate to workbench/account/ on CEP site and note that password change date seems accurate.

UI

Notes

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.09%. Comparing base (a2c9004) to head (614a66b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           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           
Flag Coverage Δ
javascript 67.10% <100.00%> (ø)
unittests 60.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
client/src/redux/sagas/profile.sagas.js 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@taoteg taoteg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some ideas to this...

Comment thread client/src/redux/sagas/profile.sagas.js Outdated
export const getPasswordStatus = (h) => {
const passwordChanged = h.filter((entry) =>
entry.comment.includes('Password changed')
entry.comment.includes('Change Password')

@taoteg taoteg Jun 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 password block
  • both the Change password and the Password changed blocks
  • only the Password changed block
    with the latest Change password block 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"
    },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can do a simple regex that searches for any combination of "password" and "change".... 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taoteg just pushed up a slightly better solution (imo), let me know what you think.

@taoteg taoteg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@happycodemonkey

Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants