Rename session_id and user_session identifiers to user_id#26
Open
joebew42 wants to merge 9 commits into
Open
Conversation
joebew42
marked this pull request as ready for review
July 1, 2026 06:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The value that flows through the backend as
session_id,session_ids, oruser_sessionis really the user's identifier — theusernameestablished inCreateUser. Naming itsession_idis misleading, and several use cases (SubscribeToUserSession,JoinChatRoom,SendMessageToChatRoom) already call this parameteruser_id. This change makes the naming consistent end-to-end so the identifier states what it actually is.This PR
Renames the identifier variables, parameters, struct fields, and helper function names that denote the user identifier —
session_id→user_id,session_ids→user_ids, anduser_session(where it holds the id value) →user_id— across the controller, supervisors, GenServers, use cases, and their tests. This is a purely internal, behaviour-preserving refactor. The session-process abstraction names (ExChat.UserSession(s),UserSessionRegistry,SubscribeToUserSession) and the repository functionfind_user_session_by/1with its message atoms are intentionally left untouched, since they name the session actor rather than the identifier. The WebSocket wire protocol carries the identifier only in the unchangedfromfield, so no frontend changes are required.Closes #12