From c04424a30dd50b0e0a9061ec28ae41be5123cb96 Mon Sep 17 00:00:00 2001 From: Gaurav Gupta Date: Wed, 17 Apr 2024 07:05:13 -0700 Subject: [PATCH] 80792 remove redis client refactor feature flag (#16353) --- config/features.yml | 4 -- .../app/services/travel_claim/redis_client.rb | 40 +++---------------- .../travel_claim/redis_client_spec.rb | 21 +--------- 3 files changed, 6 insertions(+), 59 deletions(-) diff --git a/config/features.yml b/config/features.yml index 7011dffe9f1..a97c1e93cb7 100644 --- a/config/features.yml +++ b/config/features.yml @@ -152,10 +152,6 @@ features: actor_type: user description: Enables the unified experience version of the landing page. enable_in_development: true - check_in_experience_travel_claim_redis_client_refactor: - actor_type: user - description: Uses the refactored code for Travel Claim Redis client to fetch attributes - enable_in_development: true claim_letters_access: actor_type: user description: Enables users to access the claim letters page diff --git a/modules/check_in/app/services/travel_claim/redis_client.rb b/modules/check_in/app/services/travel_claim/redis_client.rb index 0625182f995..4df98536115 100644 --- a/modules/check_in/app/services/travel_claim/redis_client.rb +++ b/modules/check_in/app/services/travel_claim/redis_client.rb @@ -33,53 +33,23 @@ def save_token(token:) end def icn(uuid:) - if Flipper.enabled?('check_in_experience_travel_claim_redis_client_refactor') - return fetch_attribute(uuid:, attribute: :icn) - end - - return nil if appointment_identifiers(uuid:).nil? - - Oj.load(appointment_identifiers(uuid:)).with_indifferent_access.dig(:data, :attributes, :icn) + fetch_attribute(uuid:, attribute: :icn) end def mobile_phone(uuid:) - if Flipper.enabled?('check_in_experience_travel_claim_redis_client_refactor') - return fetch_attribute(uuid:, attribute: :mobilePhone) - end - - return nil if appointment_identifiers(uuid:).nil? - - Oj.load(appointment_identifiers(uuid:)).with_indifferent_access.dig(:data, :attributes, :mobilePhone) + fetch_attribute(uuid:, attribute: :mobilePhone) end def patient_cell_phone(uuid:) - if Flipper.enabled?('check_in_experience_travel_claim_redis_client_refactor') - return fetch_attribute(uuid:, attribute: :patientCellPhone) - end - - return nil if appointment_identifiers(uuid:).nil? - - Oj.load(appointment_identifiers(uuid:)).with_indifferent_access.dig(:data, :attributes, :patientCellPhone) + fetch_attribute(uuid:, attribute: :patientCellPhone) end def station_number(uuid:) - if Flipper.enabled?('check_in_experience_travel_claim_redis_client_refactor') - return fetch_attribute(uuid:, attribute: :stationNo) - end - - return nil if appointment_identifiers(uuid:).nil? - - Oj.load(appointment_identifiers(uuid:)).with_indifferent_access.dig(:data, :attributes, :stationNo) + fetch_attribute(uuid:, attribute: :stationNo) end def facility_type(uuid:) - if Flipper.enabled?('check_in_experience_travel_claim_redis_client_refactor') - return fetch_attribute(uuid:, attribute: :facilityType) - end - - return nil if appointment_identifiers(uuid:).nil? - - Oj.load(appointment_identifiers(uuid:)).with_indifferent_access.dig(:data, :attributes, :facilityType) + fetch_attribute(uuid:, attribute: :facilityType) end def fetch_attribute(uuid:, attribute:) diff --git a/modules/check_in/spec/services/travel_claim/redis_client_spec.rb b/modules/check_in/spec/services/travel_claim/redis_client_spec.rb index 53a1b5a4d75..9763f2ed55c 100644 --- a/modules/check_in/spec/services/travel_claim/redis_client_spec.rb +++ b/modules/check_in/spec/services/travel_claim/redis_client_spec.rb @@ -30,9 +30,6 @@ before do allow(Rails).to receive(:cache).and_return(memory_store) - allow(Flipper).to receive(:enabled?).with('check_in_experience_travel_claim_redis_client_refactor') - .and_return(false) - Rails.cache.clear end @@ -201,23 +198,7 @@ ) end - context 'when cache exists and refactor feature flag is off' do - before do - allow(Flipper).to receive(:enabled?).with('check_in_experience_travel_claim_redis_client_refactor') - .and_return(false) - end - - it 'returns the cached value' do - expect(redis_client.facility_type(uuid:)).to eq(facility_type) - end - end - - context 'when cache exists and refactor feature flag is on' do - before do - allow(Flipper).to receive(:enabled?).with('check_in_experience_travel_claim_redis_client_refactor') - .and_return(true) - end - + context 'when cache exists' do it 'returns the cached value' do expect(redis_client.facility_type(uuid:)).to eq(facility_type) end