Skip to content

Rename session_id and user_session identifiers to user_id#26

Open
joebew42 wants to merge 9 commits into
masterfrom
issue-12-feat-rename-session-id-user-session-id-to-user-id
Open

Rename session_id and user_session identifiers to user_id#26
joebew42 wants to merge 9 commits into
masterfrom
issue-12-feat-rename-session-id-user-session-id-to-user-id

Conversation

@joebew42

@joebew42 joebew42 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

The value that flows through the backend as session_id, session_ids, or user_session is really the user's identifier — the username established in CreateUser. Naming it session_id is misleading, and several use cases (SubscribeToUserSession, JoinChatRoom, SendMessageToChatRoom) already call this parameter user_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_iduser_id, session_idsuser_ids, and user_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 function find_user_session_by/1 with 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 unchanged from field, so no frontend changes are required.

Closes #12

@joebew42 joebew42 self-assigned this Jul 1, 2026
@joebew42
joebew42 marked this pull request as ready for review July 1, 2026 06:40
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.

Rename session_id / user_session_id to user_id

1 participant