Page MenuHomePhorge

Visually indicate new user accounts
AbandonedPublic

Authored by aklapper on Nov 25 2023, 12:29.

Details

Summary

Show a star icon for available, non-disabled, verified user accounts if the user account was created within the last 30 days or if it has less than 6 actions in their activity feed.
Note that calendar non-availability, lack of email verification, and disabled account indicators still take priority.

Closes T15675

Test Plan
  1. Create a new user (with Email Not Verified), use new user to create task: Still see violet dot in front of the username
  2. Make new user verify email address: See star in front of username in task, inspect CSS and see new"phui-person-new-user-account" span class
  3. As an admin, go to http://phorge.localhost/people/create/ and "Create Mailing List User"
  4. Subscribe mailing list user to task: See no decoration in front of mailing list username in task
  5. As an admin, make sure daemons are running (e.g. via ./bin/phd restart)
  6. Make new user account add 10 comments, or change creation date of new user (via UPDATE phabricator_user.user u SET dateCreated = "1697317238" WHERE (u.userName = "new_user");)
  7. Reload task page in browser and see no star in front of username in task anymore

Diff Detail

Repository
rP Phorge
Branch
WMT64324newUser (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 953
Build 953: arc lint + arc unit

Event Timeline

This code change adds a small star to handles of new user accounts:

Screenshot from 2023-11-25 12-52-14-phorge-new-user.png (385×1 px, 70 KB)

avivey requested changes to this revision.Nov 25 2023, 14:24
avivey subscribed.

I aslo don't see the point of this feature, but that's another issue.

src/applications/phid/PhabricatorObjectHandle.php
351

adding a search query here would be extremely slow - it adds a new query (2, infact) for each person mentioned in a page - that can add up to hundreds or thousands new calls.

This revision now requires changes to proceed.Nov 25 2023, 14:24
speck added inline comments.
src/applications/phid/PhabricatorObjectHandle.php
351

Looking a little bit into how similar things like this get handled, it looks like PhabricatorPeopleQuery has flags like needBadgeAwards which is used in fillUserCaches(). It looks like there's a database table for specific types of caches (such as PhabricatorUserCache), which is what fillUserCaches() uses, to pull cached values and populate them if they had to be computed. This is probably the route we would want to take here, especially for something like the querying the user's feed, to ensure it's cached and the query for users will pull that computed value from the cache in most cases.

Makes sense, thanks everyone. Let's decline for the time being.