fix(presence): remove presence for a solo user#1779
Merged
waleedlatif1 merged 1 commit intostagingfrom Oct 31, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR fixes a bug where solo users would see their own avatar in the presence indicator. The fix filters out the current user from the presence list by comparing user IDs.
Key Changes:
- Modified
usePresencehook to import and useuseSessionto get current user ID - Added filter to exclude users where
user.userId === currentUserIdfrom the presence list - Removed redundant code comments from avatar and socket handler files for cleaner code
Implementation:
The presence list from the socket server includes all users in a workflow room. By filtering out entries matching the current user's session ID, only other collaborators are displayed in the avatar stack. The filter is applied in the useMemo hook with currentUserId as a dependency to ensure proper reactivity when the session loads.
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The change is straightforward and well-implemented. It uses a simple filter to remove the current user from the presence list, consistent with similar patterns used throughout the codebase. The implementation correctly adds the dependency to useMemo and follows existing code conventions.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-presence.ts | 5/5 | Added filter to exclude current user from presence list using session.user.id |
Sequence Diagram
sequenceDiagram
participant Client as Client Browser
participant Hook as usePresence Hook
participant Auth as Auth Session
participant Socket as Socket Context
participant Server as Socket Server
Client->>Auth: Load user session
Auth-->>Hook: session.user.id
Client->>Socket: Connect to workflow
Socket->>Server: join-workflow
Server->>Server: Add user to room
Server->>Socket: presence-update (all users)
Socket-->>Hook: presenceUsers array
Hook->>Hook: Filter out current user<br/>(user.userId !== currentUserId)
Hook-->>Client: Return filtered users<br/>(excluding self)
3 files reviewed, no comments
waleedlatif1
added a commit
that referenced
this pull request
Nov 12, 2025
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.
Summary
Type of Change
Testing
Tested manually.
Checklist