Skip to content

docs: fix UserPreDeleteEvent accessors in README - #360

Merged
devondragon merged 1 commit into
mainfrom
docs/user-pre-delete-event-accessors
Aug 15, 2026
Merged

docs: fix UserPreDeleteEvent accessors in README#360
devondragon merged 1 commit into
mainfrom
docs/user-pre-delete-event-accessors

Conversation

@devondragon

Copy link
Copy Markdown
Owner

The README described UserPreDeleteEvent as carrying the User entity via event.getUser() (line 968) and used event.getUser().getId() in the listener example (line 998). Since 5.0.0 the event exposes only getUserId() and getUserEmail() (UserPreDeleteEvent.java:52,61); the example did not compile as written. Updated the description and the example to match the class and the demo app's actual UserProfileDeletionListener. Found while rewriting the demo app's docs (devondragon/SpringUserFrameworkDemoApp#85).

Copilot AI lite review requested due to automatic review settings August 15, 2026 16:49
@claude

claude Bot commented Aug 15, 2026

Copy link
Copy Markdown

Reviewed. This is a small, accurate doc fix — verified against UserPreDeleteEvent.java (src/main/java/com/digitalsanctuary/spring/user/event/UserPreDeleteEvent.java), which as of 5.0.0 only exposes getUserId() and getUserEmail(), not getUser(). The updated README text and code example match the actual API.

  • Correctness: ✅ Confirmed the class no longer carries the User entity (by design, to avoid detached-entity/LazyInitializationException issues per the class Javadoc). The old event.getUser().getId() example genuinely wouldn't compile.
  • Consistency: ✅ Checked the rest of README.md for other UserPreDeleteEvent references (lines 1186, 1200-1201) — they already use getUserEmail()/getUserId(), so this PR closes the last stale reference and the doc is now internally consistent.
  • Scope: Minimal, docs-only, 2-line diff — no code/behavior changes, no tests needed.

No issues found. LGTM.

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

Updates the library’s README documentation so consuming applications can correctly handle UserPreDeleteEvent as it exists since 5.0.0 (carrying scalar userId/userEmail rather than a User entity), ensuring the provided listener example matches the actual public API.

Changes:

  • Corrected the UserPreDeleteEvent description to reflect that it exposes getUserId() and getUserEmail() (and does not carry a User entity).
  • Updated the README’s listener example to use event.getUserId() instead of event.getUser().getId().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@devondragon
devondragon merged commit 4f43b29 into main Aug 15, 2026
4 checks passed
@devondragon
devondragon deleted the docs/user-pre-delete-event-accessors branch August 15, 2026 16:50
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