Skip to content

Fix: Remove disabled users from the lookup server - #213

Closed
rikled wants to merge 2 commits into
masterfrom
fix/remove-disabled-users-from-lookup
Closed

Fix: Remove disabled users from the lookup server#213
rikled wants to merge 2 commits into
masterfrom
fix/remove-disabled-users-from-lookup

Conversation

@rikled

@rikled rikled commented Jun 29, 2026

Copy link
Copy Markdown

Deactivated accounts were never removed from the lookup server: batchUpdate() re-pushed them on every cron run and nothing reacted to disable events, so disabled users kept showing up in federated share contacts.

This change:

  • skips disabled users in batchUpdate() and batches their removal,
  • hardens updateUser() to remove rather than re-add a disabled user,
  • adds a UserChanged listener so enable/disable is reflected immediately instead of waiting for the next cron run,
  • adds unit tests covering the add/remove routing.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Assisted-by: Claude Code:Opus 4.8

rikled added 2 commits June 29, 2026 11:42
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
Assisted-by: Claude Code:Opus 4.8
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>

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

Might be similar to #215
cc @cristianscheid

@cristianscheid

cristianscheid commented Jul 1, 2026

Copy link
Copy Markdown
Member

Might be similar to #215 cc @cristianscheid

Yes, looking at the changes it accomplishes the same thing as #215. Major difference is how PRs handle existing disabled users on lookup server:

  • this PR uses batchUpdate() method, which is called on a cron job
  • #215 removes the user at login time, if the disabled user attempts to authenticate, rather than on a schedule

@cristianscheid

Copy link
Copy Markdown
Member

Following up on this topic, I've updated #215 to include the changes proposed by this PR for the batchUpdate() method.

Changes on #215 were included on this commit. I think this makes sense because only removing disabled users at login time would leave their records on the lookup server until they actually attempt to log in. Including this change means the cron job will eventaually clean up any leftover disabled users.

@rikled thanks for the contribution, really appreciated! Since now both PRs are more in sync, I'll close this one in favor of the previously open.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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.

3 participants