Skip to content
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

Changing user display name does not change lock owner name #34315

Closed
phil-davis opened this issue Jan 30, 2019 · 5 comments
Closed

Changing user display name does not change lock owner name #34315

phil-davis opened this issue Jan 30, 2019 · 5 comments

Comments

@phil-davis
Copy link
Contributor

phil-davis commented Jan 30, 2019

  1. login as some user Alice with display name set to Original Name
  2. lock a file or folder
  3. change your display name to New name
  4. view the locks tab of the file/folder details

Expected result

Lock owner is displayed as New Name

Actual result

Lock owner is displayed as Original Name

@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #3101 (Admin user can't change the Display Name of other Users), #809 (Lock or disable users), #1503 (Changing user password doesn't trigger hook listeners), #1371 (Display name not editable by user), and #9544 (Can't Change Full Name for Users).

@phil-davis
Copy link
Contributor Author

The oc_persistent_locks table has stuff like:

mysql> select * from oc_persistent_locks;
+----+------------+------------------+---------------+---------+------------+--------------------------------------+----------------------------------+-------+-------+
| id | file_id    | owner_account_id | owner         | timeout | created_at | token                                | token_hash                       | scope | depth |
+----+------------+------------------+---------------+---------+------------+--------------------------------------+----------------------------------+-------+-------+
|  9 | 2147492032 |               57 | My fancy name |    1800 | 1548833262 | 9b86317e-6f3f-4d6b-91f3-2bd78029573a | dd2eb08e480e12c4277a178e96475572 |     2 |    -1 |
| 10 | 2147492031 |               57 | My fancy name |    1800 | 1548833262 | 458ee95b-a353-4876-abda-d331c3d9e537 | 8cbfb6821e0649a5afec948a325ea5f2 |     1 |    -1 |
+----+------------+------------------+---------------+---------+------------+--------------------------------------+----------------------------------+-------+-------+
2 rows in set (0.00 sec)

So I guess that owner field becomes stale.

Maybe the owner should be the username, and the current display name should be looked up on-the-fly.

@phil-davis
Copy link
Contributor Author

phil-davis commented Jan 30, 2019

Note: oc_persistent_locks already has field owner_account_id

IMO the username (UID), display name, email address etc can be found by looking up the information starting from the owner_account_id - so probably the owner field is redundant and could be dropped.

"not storing redundant data" = "no chance for the redundant data to become stale"

@PVince81 PVince81 added this to the QA milestone Jan 30, 2019
@PVince81 PVince81 modified the milestones: QA, backlog Jan 30, 2019
@phil-davis
Copy link
Contributor Author

Removed the QA-team label because this has a test to cover the behavior.

@stale
Copy link

stale bot commented Sep 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants