Skip to content

Commit

Permalink
fix: Rescue not existing user in channel
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrubisch committed Mar 28, 2024
1 parent f685bdf commit 9043b80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/channels/cubism/presence_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ def unsubscribed

def appear
resource.set_present_users_for_scope(resource.present_users_for_scope(scope).add(user.id), scope) if scope
rescue ActiveRecord::RecordNotFound
# do nothing if the user wasn't found
end

def disappear
resource.set_present_users_for_scope(resource.present_users_for_scope(scope).delete(user.id), scope) if scope
rescue ActiveRecord::RecordNotFound
# do nothing if the user wasn't found
end

private
Expand Down

0 comments on commit 9043b80

Please sign in to comment.