Skip to content

Commit

Permalink
log mobile push errors (#19813)
Browse files Browse the repository at this point in the history
  • Loading branch information
aherzberg authored Dec 11, 2024
1 parent e558321 commit f01b6fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,9 @@ features:
appointment_provider_id_logging:
actor_type: user
description: For mobile app, logs provider id for debugging
mobile_push_register_logging:
actor_type: user
description: For mobile app, logs push register errors for debugging
form526_backup_submission_temp_killswitch:
actor_type: user
description: Provide a temporary killswitch to disable form526 backup submission if something were to go awry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ module Mobile
module V0
class PushNotificationsController < ApplicationController
def register
result = service.register(
get_app_name(params),
params[:device_token],
@current_user.icn,
params[:os_name],
params[:device_name] || params[:os_name]
)
begin
result = service.register(
get_app_name(params),
params[:device_token],
@current_user.icn,
params[:os_name],
params[:device_name] || params[:os_name]
)
rescue => e
if Flipper.enabled?(:mobile_push_register_logging, @current_user)
PersonalInformationLog.create!(
data: { icn: @current_user.icn, message: e.message, backtrace: e.backtrace },
error_class: 'Mobile Push Register Error'
)
end

raise e
end

render json: Mobile::V0::PushRegisterSerializer.new(params[:app_name], result.body[:sid])
end
Expand Down

0 comments on commit f01b6fc

Please sign in to comment.