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

fix(settings): Delete settings when a user is deleted #1583

Merged
merged 1 commit into from Jun 21, 2023

Conversation

nickvergessen
Copy link
Member

Fix #1572

cc @oleole39 in case you want to review

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
Copy link
Member Author

/backport to stable27

@nickvergessen
Copy link
Member Author

/backport to stable26

@nickvergessen
Copy link
Member Author

/backport to stable25

@nickvergessen nickvergessen merged commit be44291 into master Jun 21, 2023
24 checks passed
@nickvergessen nickvergessen deleted the bugfix/1572/delete-settings-on-user-deletion branch June 21, 2023 08:30
@backportbot-nextcloud
Copy link

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@nickvergessen
Copy link
Member Author

/backport to stable25

@backportbot-nextcloud
Copy link

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25

# Create the new backport branch
git checkout -b fix/foo-stable25

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@oleole39
Copy link

oleole39 commented Jun 21, 2023

Fix #1572
cc @oleole39 in case you want to review

I confirm that after applying the fix manually, I can't find any entry related to to the test user in the database anymore as far as oc_notifications_settings table is concerned.

Comparing with the result of a test performed before applying the fix, I actually I see that references to the same test user have also disappeared in other tables:

  • oc_circles_event
  • oc_circles_member
  • oc_ldap_group_members

Could they be related to that fix as well (which would a good thing I believe)?

Here are for reference the remaining entries in the DB found after a new test:
INSERT INTO `oc_addressbookchanges` VALUES (44,'LDAP:newtestuser2.vcf',44,2,1);
INSERT INTO `oc_addressbookchanges` VALUES (45,'LDAP:newtestuser2.vcf',45,2,2);
INSERT INTO `oc_addressbookchanges` VALUES (46,'LDAP:newtestuser2.vcf',46,2,3);
INSERT INTO `oc_filecache` VALUES (16331,2,'appdata_ocj3l4h9vi3l/identityproof/user-newtestuser2','38afde154d4485f20f0dbc16690cf7a1',62,'user-newtestuser2',2,1,0,1687352403,1687352403,0,0,'6492f4538f3b1',31,'');
INSERT INTO `oc_filecache` VALUES (16332,2,'appdata_ocj3l4h9vi3l/identityproof/user-newtestuser2/private','924817a9b098956cd775cef5b1dd4525',16331,'private',8,3,3588,1687352403,1687352403,0,0,'a55e87b61085404456b0df49f25d2635',27,'');
INSERT INTO `oc_filecache` VALUES (16333,2,'appdata_ocj3l4h9vi3l/identityproof/user-newtestuser2/public','c40e021382e9aefc0cbd5c223680f5eb',16331,'public',8,3,451,1687352403,1687352403,0,0,'5b172675fad7f0ecda119626479ac034',27,'');
INSERT INTO `oc_jobs` VALUES (393,'OCA\\Settings\\BackgroundJobs\\VerifyUserData','{\"verificationCode\":\"\",\"data\":\"newtestuser2@mydomain.tld\",\"type\":\"email\",\"uid\":\"newtestuser2\",\"try\":0,\"lastRun\":1687352103}',0,1>
INSERT INTO `oc_jobs` VALUES (407,'OCA\\Forms\\BackgroundJob\\UserDeletedJob','{\"owner_id\":\"newtestuser2\"}',0,1687353456,0,0,'52316aebaa1090836d3039285bd5ff04',1);
INSERT INTO `oc_jobs` VALUES (408,'OCA\\Polls\\Cron\\UserDeletedJob','{\"owner\":\"newtestuser2\"}',0,1687353456,0,0,'cbaa2f79d8164c0c2f4a8c7e942baae6',1);
INSERT INTO `oc_mail_tags` VALUES (37,'newtestuser2','$label1','Important','#FF7A66',1);
INSERT INTO `oc_mail_tags` VALUES (38,'newtestuser2','$label2','Travail','#31CC7C',1);
INSERT INTO `oc_mail_tags` VALUES (39,'newtestuser2','$label3','Personnel','#A85BF7',1);
INSERT INTO `oc_mail_tags` VALUES (40,'newtestuser2','$label4','À faire','#317CCC',1);
INSERT INTO `oc_mail_tags` VALUES (41,'newtestuser2','$label5','Plus tard','#B4A443',1);
INSERT INTO `oc_storages` VALUES (26,'local::/home/yunohost.multimedia/newtestuser2/',1,NULL);

@nickvergessen
Copy link
Member Author

Could they be related to that fix as well (which would a good thing I believe)?

No, but as per server ticket some apps queued clean up jobs and you now basically waited long enough for the background jobs to be executed

@nickvergessen
Copy link
Member Author

Stable25 in #1592

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

Successfully merging this pull request may close these issues.

[Bug]: After removing a user with occ, some of its related data remains in DB table oc_notifications_settings
3 participants