Compare commits

...
Author SHA1 Message Date
Vishnu Narayanan dcb5369c48 chore: log account_id 2024-11-14 23:41:52 +05:30
Vishnu Narayanan d1596653fd chore: log inbox id 2024-11-14 23:08:37 +05:30
Vishnu Narayanan 4f4dcef4f1 chore: log params 2024-11-14 22:27:29 +05:30
Vishnu Narayanan e5ecb84277 chore: log params for update_presence 2024-11-14 22:19:25 +05:30
Vishnu Narayanan 11cf49db43 chore: push update_presence logs 2024-11-14 21:55:55 +05:30
2 changed files with 13 additions and 5 deletions
+9 -1
View File
@@ -2,7 +2,7 @@ class RoomChannel < ApplicationCable::Channel
def subscribed
# TODO: should we only do ensure stream if current account is present?
# for now going ahead with guard clauses in update_subscription and broadcast_presence
log_params
ensure_stream
current_user
current_account
@@ -10,7 +10,15 @@ class RoomChannel < ApplicationCable::Channel
broadcast_presence
end
def log_params
contact_inbox = ContactInbox.find_by(pubsub_token: params[:pubsub_token])
inbox_id = contact_inbox&.inbox_id
account_id = contact_inbox&.inbox&.account_id
Rails.logger.info("update_presence: #{params.inspect}, inbox_id: #{inbox_id}, account_id: #{account_id}")
end
def update_presence
log_params
update_subscription
broadcast_presence
end
+4 -4
View File
@@ -22,9 +22,9 @@ if ActiveModel::Type::Boolean.new.cast(ENV.fetch('LOGRAGE_ENABLED', false)).pres
}
end
config.lograge.ignore_custom = lambda do |event|
# ignore update_presence events in log
return true if event.payload[:channel_class] == 'RoomChannel'
end
# config.lograge.ignore_custom = lambda do |event|
# # ignore update_presence events in log
# return true if event.payload[:channel_class] == 'RoomChannel'
# end
end
end