Skip to content

[LFXV2-2645] feat(users): publish user-deleted event for project settings username scrub - #137

Closed
andrest50 wants to merge 1 commit into
mainfrom
fix/LFXV2-2645-project-settings-username-scrub
Closed

[LFXV2-2645] feat(users): publish user-deleted event for project settings username scrub#137
andrest50 wants to merge 1 commit into
mainfrom
fix/LFXV2-2645-project-settings-username-scrub

Conversation

@andrest50

Copy link
Copy Markdown
Contributor

Summary

  • Publish lfx.v1-sync-helper.user.deleted when a merged user is soft-deleted so downstream v2 services can scrub the LFID from settings.
  • Keeps the delete handler best-effort: publish failures are logged but do not block username index cleanup or KV ACK.
  • Adds unit coverage for publish/no-publish paths (username present, absent, hard KV delete).

Context

Complements the committee-service work in lfx-v2-committee-service#161 and enables the matching project-service handler in lfx-v2-project-service.

Note: overlaps with lfx-v1-sync-helper#133; only one of these v1-sync-helper PRs needs to merge — this branch generalizes the event wording for both committee and project consumers.

Test plan

  • go test ./cmd/lfx-v1-sync-helper/ -run TestHandleMergedUserDeleteScrub
  • Deploy with project-service PR and soft-delete a test user; confirm NATS event is published and project settings LFID is cleared

Made with Cursor

LFXV2-2645)

When a merged user is soft-deleted, publish lfx.v1-sync-helper.user.deleted so committee and project services can clear the LFID from settings without blocking the KV delete handler.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 27, 2026 19:43
@andrest50
andrest50 requested a review from a team as a code owner July 27, 2026 19:43

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

Pull request overview

Publishes user-deletion events so downstream project and committee services can scrub deleted LFIDs from settings.

Changes:

  • Adds best-effort NATS event publishing for soft-deleted users.
  • Adds tests for publish, missing-username, and hard-delete paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/lfx-v1-sync-helper/handlers_users.go Publishes the user-deleted event.
cmd/lfx-v1-sync-helper/handlers_users_test.go Tests event-trigger conditions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrest50

Copy link
Copy Markdown
Contributor Author

Closing in favor of #133 — both publish lfx.v1-sync-helper.user.deleted with the same payload; #133 already unblocks project-service #96 and committee-service #161.

@andrest50 andrest50 closed this Jul 27, 2026
@andrest50
andrest50 deleted the fix/LFXV2-2645-project-settings-username-scrub branch July 27, 2026 19:47
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