From 66c674c8ec9434197d3b2b56a80959ae890fb3f2 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Mon, 19 Dec 2022 16:06:08 -0500 Subject: [PATCH 1/6] Switching newer Acuant SDK to be the default version -- What The introduction of the AB Testing framework for upgrading the Acuant SDK assumes that the "newer" version is the one being tested, and that the older is the "default". This change updates the step doc capture step to assume that version 11.7.1 should be used in all cases when the ab test is switched off. changelog: Internal, Upgrades, Acuant SDK Upgrade --- .../idv/steps/document_capture_step.rb | 8 +++--- .../idv/steps/document_capture_step_spec.rb | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/services/idv/steps/document_capture_step.rb b/app/services/idv/steps/document_capture_step.rb index fb18b941ff4..220f62a3e88 100644 --- a/app/services/idv/steps/document_capture_step.rb +++ b/app/services/idv/steps/document_capture_step.rb @@ -43,11 +43,13 @@ def native_camera_ab_testing_variables def acuant_sdk_upgrade_a_b_testing_variables bucket = AbTests::ACUANT_SDK.bucket(flow_session[:document_capture_session_uuid]) - acuant_version = (bucket == :use_newer_sdk) ? '11.7.1' : '11.7.0' + testing_enabled = IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled + use_newer_sdk = (bucket == :use_newer_sdk) + acuant_version = (testing_enabled && !use_newer_sdk) ? '11.7.0' : '11.7.1' { acuant_sdk_upgrade_a_b_testing_enabled: - IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled, - use_newer_sdk: (bucket == :use_newer_sdk), + testing_enabled, + use_newer_sdk: use_newer_sdk, acuant_version: acuant_version, } end diff --git a/spec/services/idv/steps/document_capture_step_spec.rb b/spec/services/idv/steps/document_capture_step_spec.rb index 34fd1816c1c..cf29dfc24ce 100644 --- a/spec/services/idv/steps/document_capture_step_spec.rb +++ b/spec/services/idv/steps/document_capture_step_spec.rb @@ -54,6 +54,32 @@ end describe '#extra_view_variables' do + context 'with acuant sdk upgrade A/B testing disabled' do + let(:session_uuid) { SecureRandom.uuid } + + before do + allow(IdentityConfig.store). + to receive(:idv_acuant_sdk_upgrade_a_b_testing_enabled). + and_return(false) + + flow.flow_session[:document_capture_session_uuid] = session_uuid + end + + context 'and A/B test specifies the older acuant version' do + before do + stub_const( + 'AbTests::ACUANT_SDK', + FakeAbTestBucket.new.tap { |ab| ab.assign(session_uuid => 0) }, + ) + end + + it 'passes correct variables and acuant version when older is specified' do + expect(subject.extra_view_variables[:acuant_sdk_upgrade_a_b_testing_enabled]).to eq(false) + expect(subject.extra_view_variables[:use_newer_sdk]).to eq(false) + expect(subject.extra_view_variables[:acuant_version]).to eq('11.7.1') + end + end + end context 'with acuant sdk upgrade A/B testing enabled' do let(:session_uuid) { SecureRandom.uuid } From 443179c4f50ab9d92cc1a8e2d287d6f1c7808706 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Tue, 20 Dec 2022 14:40:54 -0500 Subject: [PATCH 2/6] Specifying acuant versions in configs and updating names Specifically, we are switching from use_newer_sdk to use_alternate_sdk changelog: Internal, Upgrades, Acuant SDK Upgrade --- app/javascript/packs/document-capture.tsx | 6 +++--- .../idv/steps/document_capture_step.rb | 10 +++++++--- .../idv/capture_doc/document_capture.html.erb | 2 +- .../idv/doc_auth/document_capture.html.erb | 2 +- .../idv/shared/_document_capture.html.erb | 2 +- config/application.yml.default | 2 ++ config/initializers/ab_tests.rb | 2 +- lib/identity_config.rb | 2 ++ spec/features/idv/analytics_spec.rb | 12 ++++++------ .../idv/steps/document_capture_step_spec.rb | 18 +++++++++++------- .../shared/_document_capture.html.erb_spec.rb | 4 ++-- 11 files changed, 37 insertions(+), 25 deletions(-) diff --git a/app/javascript/packs/document-capture.tsx b/app/javascript/packs/document-capture.tsx index c8f36c47f18..5cfa0d640c3 100644 --- a/app/javascript/packs/document-capture.tsx +++ b/app/javascript/packs/document-capture.tsx @@ -26,7 +26,7 @@ interface AppRootData { maxCaptureAttemptsBeforeTips: string; maxAttemptsBeforeNativeCamera: string; acuantSdkUpgradeABTestingEnabled: string; - useNewerSdk: string; + useAlternateSdk: string; acuantVersion: string; flowPath: FlowPath; cancelUrl: string; @@ -65,13 +65,13 @@ function getMetaContent(name): string | null { const device: DeviceContextValue = { isMobile: isCameraCapableMobile() }; const trackEvent: typeof baseTrackEvent = (event, payload) => { - const { flowPath, acuantSdkUpgradeABTestingEnabled, useNewerSdk, acuantVersion } = + const { flowPath, acuantSdkUpgradeABTestingEnabled, useAlternateSdk, acuantVersion } = appRoot.dataset; return baseTrackEvent(event, { ...payload, flow_path: flowPath, acuant_sdk_upgrade_a_b_testing_enabled: acuantSdkUpgradeABTestingEnabled, - use_newer_sdk: useNewerSdk, + use_alternate_sdk: useAlternateSdk, acuant_version: acuantVersion, }); }; diff --git a/app/services/idv/steps/document_capture_step.rb b/app/services/idv/steps/document_capture_step.rb index 220f62a3e88..c2fc84ec17b 100644 --- a/app/services/idv/steps/document_capture_step.rb +++ b/app/services/idv/steps/document_capture_step.rb @@ -44,12 +44,16 @@ def native_camera_ab_testing_variables def acuant_sdk_upgrade_a_b_testing_variables bucket = AbTests::ACUANT_SDK.bucket(flow_session[:document_capture_session_uuid]) testing_enabled = IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled - use_newer_sdk = (bucket == :use_newer_sdk) - acuant_version = (testing_enabled && !use_newer_sdk) ? '11.7.0' : '11.7.1' + use_alternate_sdk = (bucket == :use_alternate_sdk) + if testing_enabled && use_alternate_sdk + acuant_version = IdentityConfig.store.idv_acuant_sdk_version_alternate + else + acuant_version = IdentityConfig.store.idv_acuant_sdk_version_default + end { acuant_sdk_upgrade_a_b_testing_enabled: testing_enabled, - use_newer_sdk: use_newer_sdk, + use_alternate_sdk: use_alternate_sdk, acuant_version: acuant_version, } end diff --git a/app/views/idv/capture_doc/document_capture.html.erb b/app/views/idv/capture_doc/document_capture.html.erb index 96e13ed4fe0..558e540c1c3 100644 --- a/app/views/idv/capture_doc/document_capture.html.erb +++ b/app/views/idv/capture_doc/document_capture.html.erb @@ -7,6 +7,6 @@ front_image_upload_url: front_image_upload_url, back_image_upload_url: back_image_upload_url, acuant_sdk_upgrade_a_b_testing_enabled: acuant_sdk_upgrade_a_b_testing_enabled, - use_newer_sdk: use_newer_sdk, + use_alternate_sdk: use_alternate_sdk, acuant_version: acuant_version, ) %> diff --git a/app/views/idv/doc_auth/document_capture.html.erb b/app/views/idv/doc_auth/document_capture.html.erb index b025a507948..83de02e8367 100644 --- a/app/views/idv/doc_auth/document_capture.html.erb +++ b/app/views/idv/doc_auth/document_capture.html.erb @@ -7,6 +7,6 @@ front_image_upload_url: front_image_upload_url, back_image_upload_url: back_image_upload_url, acuant_sdk_upgrade_a_b_testing_enabled: acuant_sdk_upgrade_a_b_testing_enabled, - use_newer_sdk: use_newer_sdk, + use_alternate_sdk: use_alternate_sdk, acuant_version: acuant_version, ) %> diff --git a/app/views/idv/shared/_document_capture.html.erb b/app/views/idv/shared/_document_capture.html.erb index 7aa34d2c11b..deca885ec3f 100644 --- a/app/views/idv/shared/_document_capture.html.erb +++ b/app/views/idv/shared/_document_capture.html.erb @@ -32,7 +32,7 @@ max_capture_attempts_before_native_camera: IdentityConfig.store.doc_auth_max_capture_attempts_before_native_camera, max_submission_attempts_before_native_camera: IdentityConfig.store.doc_auth_max_submission_attempts_before_native_camera, acuant_sdk_upgrade_a_b_testing_enabled: acuant_sdk_upgrade_a_b_testing_enabled, - use_newer_sdk: use_newer_sdk, + use_alternate_sdk: use_alternate_sdk, acuant_version: acuant_version, sp_name: sp_name, flow_path: flow_path, diff --git a/config/application.yml.default b/config/application.yml.default index 3ec13f201ca..9699a255fbf 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -114,6 +114,8 @@ idv_attempt_window_in_hours: 6 idv_contact_url: https://www.example.com idv_max_attempts: 5 idv_min_age_years: 13 +idv_acuant_sdk_version_default: '11.7.1' +idv_acuant_sdk_version_alternate: '11.7.0' idv_acuant_sdk_upgrade_a_b_testing_enabled: false idv_acuant_sdk_upgrade_a_b_testing_percent: 50 idv_send_link_attempt_window_in_minutes: 10 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index d8388e9a3b6..4df55b07756 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -13,7 +13,7 @@ module AbTests ACUANT_SDK = AbTestBucket.new( experiment_name: 'Acuant SDK Upgrade', buckets: { - use_newer_sdk: IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled ? + use_alternate_sdk: IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled ? IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_percent : 0, }, diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 1a62c38af3c..a00fcca1f70 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -193,6 +193,8 @@ def self.build_store(config_map) config.add(:idv_contact_url, type: :string) config.add(:idv_max_attempts, type: :integer) config.add(:idv_min_age_years, type: :integer) + config.add(:idv_acuant_sdk_version_default, type: :string) + config.add(:idv_acuant_sdk_version_alternate, type: :string) config.add(:idv_acuant_sdk_upgrade_a_b_testing_enabled, type: :boolean) config.add(:idv_acuant_sdk_upgrade_a_b_testing_percent, type: :integer) config.add(:idv_send_link_attempt_window_in_minutes, type: :integer) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 061aa65c1a8..54ecaa525ce 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -17,8 +17,8 @@ 'IdV: doc auth upload visited' => { flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, - 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'IdV: doc auth image upload form submitted' => { success: true, errors: {}, attempts: 1, remaining_attempts: 3, user_id: user.uuid, flow_path: 'standard' }, 'IdV: doc auth image upload vendor pii validation' => { success: true, errors: {}, user_id: user.uuid, attempts: 1, remaining_attempts: 3, flow_path: 'standard', attention_with_barcode: false }, 'IdV: doc auth document_capture submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'document_capture', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, @@ -53,8 +53,8 @@ 'IdV: doc auth upload visited' => { flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, - 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'IdV: doc auth image upload form submitted' => { success: true, errors: {}, attempts: 1, remaining_attempts: 3, user_id: user.uuid, flow_path: 'standard' }, 'IdV: doc auth image upload vendor pii validation' => { success: true, errors: {}, user_id: user.uuid, attempts: 1, remaining_attempts: 3, flow_path: 'standard', attention_with_barcode: false }, 'IdV: doc auth document_capture submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'document_capture', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, @@ -85,8 +85,8 @@ 'IdV: doc auth upload visited' => { flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth upload submitted' => { success: true, errors: {}, destination: :document_capture, flow_path: 'standard', step: 'upload', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, 'IdV: doc auth document_capture visited' => { flow_path: 'standard', step: 'document_capture', step_count: 1, acuant_sdk_upgrade_ab_test_bucket: :default, analytics_id: 'Doc Auth', irs_reproofing: false }, - 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, - 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_newer_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: front image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, + 'Frontend: IdV: back image added' => { 'width' => 284, 'height' => 38, 'mimeType' => 'image/png', 'source' => 'upload', 'size' => 3694, 'attempt' => 1, 'flow_path' => 'standard', 'acuant_sdk_upgrade_a_b_testing_enabled' => 'false', 'use_alternate_sdk' => anything, 'acuant_version' => anything }, 'IdV: doc auth image upload form submitted' => { success: true, errors: {}, attempts: 1, remaining_attempts: 3, user_id: user.uuid, flow_path: 'standard' }, 'IdV: doc auth image upload vendor submitted' => hash_including(success: true, flow_path: 'standard', attention_with_barcode: true, doc_auth_result: 'Attention'), 'IdV: verify in person troubleshooting option clicked' => { flow_path: 'standard' }, diff --git a/spec/services/idv/steps/document_capture_step_spec.rb b/spec/services/idv/steps/document_capture_step_spec.rb index cf29dfc24ce..febdd665427 100644 --- a/spec/services/idv/steps/document_capture_step_spec.rb +++ b/spec/services/idv/steps/document_capture_step_spec.rb @@ -40,6 +40,9 @@ end end + let(:default_sdk_version) { IdentityConfig.store.idv_acuant_sdk_version_default } + let(:alternate_sdk_version) { IdentityConfig.store.idv_acuant_sdk_version_alternate } + subject(:step) do Idv::Steps::DocumentCaptureStep.new(flow) end @@ -75,11 +78,12 @@ it 'passes correct variables and acuant version when older is specified' do expect(subject.extra_view_variables[:acuant_sdk_upgrade_a_b_testing_enabled]).to eq(false) - expect(subject.extra_view_variables[:use_newer_sdk]).to eq(false) - expect(subject.extra_view_variables[:acuant_version]).to eq('11.7.1') + expect(subject.extra_view_variables[:use_alternate_sdk]).to eq(false) + expect(subject.extra_view_variables[:acuant_version]).to eq(default_sdk_version) end end end + context 'with acuant sdk upgrade A/B testing enabled' do let(:session_uuid) { SecureRandom.uuid } @@ -95,14 +99,14 @@ before do stub_const( 'AbTests::ACUANT_SDK', - FakeAbTestBucket.new.tap { |ab| ab.assign(session_uuid => :use_newer_sdk) }, + FakeAbTestBucket.new.tap { |ab| ab.assign(session_uuid => :use_alternate_sdk) }, ) end it 'passes correct variables and acuant version when newer is specified' do expect(subject.extra_view_variables[:acuant_sdk_upgrade_a_b_testing_enabled]).to eq(true) - expect(subject.extra_view_variables[:use_newer_sdk]).to eq(true) - expect(subject.extra_view_variables[:acuant_version]).to eq('11.7.1') + expect(subject.extra_view_variables[:use_alternate_sdk]).to eq(true) + expect(subject.extra_view_variables[:acuant_version]).to eq(alternate_sdk_version) end end @@ -116,8 +120,8 @@ it 'passes correct variables and acuant version when older is specified' do expect(subject.extra_view_variables[:acuant_sdk_upgrade_a_b_testing_enabled]).to eq(true) - expect(subject.extra_view_variables[:use_newer_sdk]).to eq(false) - expect(subject.extra_view_variables[:acuant_version]).to eq('11.7.0') + expect(subject.extra_view_variables[:use_alternate_sdk]).to eq(false) + expect(subject.extra_view_variables[:acuant_version]).to eq(default_sdk_version) end end end diff --git a/spec/views/idv/shared/_document_capture.html.erb_spec.rb b/spec/views/idv/shared/_document_capture.html.erb_spec.rb index d7653696839..a4563c01318 100644 --- a/spec/views/idv/shared/_document_capture.html.erb_spec.rb +++ b/spec/views/idv/shared/_document_capture.html.erb_spec.rb @@ -14,7 +14,7 @@ let(:front_image_upload_url) { nil } let(:back_image_upload_url) { nil } let(:acuant_sdk_upgrade_a_b_testing_enabled) { false } - let(:use_newer_sdk) { false } + let(:use_alternate_sdk) { false } let(:acuant_version) { '11.7.1' } before do @@ -48,7 +48,7 @@ front_image_upload_url: front_image_upload_url, back_image_upload_url: back_image_upload_url, acuant_sdk_upgrade_a_b_testing_enabled: acuant_sdk_upgrade_a_b_testing_enabled, - use_newer_sdk: use_newer_sdk, + use_alternate_sdk: use_alternate_sdk, acuant_version: acuant_version, } end From b4209981a0c98e642310064f133a1616d9c69736 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Tue, 20 Dec 2022 14:52:24 -0500 Subject: [PATCH 3/6] Acuant context should use config's acuant version by default changelog: Internal, Upgrades, Acuant SDK Upgrade --- .../packages/document-capture/context/acuant.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/packages/document-capture/context/acuant.tsx b/app/javascript/packages/document-capture/context/acuant.tsx index d81d64c4f1a..b423f854e4d 100644 --- a/app/javascript/packages/document-capture/context/acuant.tsx +++ b/app/javascript/packages/document-capture/context/acuant.tsx @@ -1,5 +1,6 @@ import { createContext, useContext, useEffect, useState } from 'react'; import type { ReactNode } from 'react'; +import { getConfigValue } from '@18f/identity-config'; import useObjectMemo from '@18f/identity-react-hooks/use-object-memo'; import DeviceContext from './device'; import AnalyticsContext from './analytics'; @@ -192,9 +193,15 @@ const getActualAcuantCamera = (): AcuantCameraInterface => { return AcuantCamera; }; +/** + * The default version of the Acuant SDK to use, + * as specified in the application config + */ +const acuantVersion = getConfigValue('acuantVersion'); + function AcuantContextProvider({ - sdkSrc = '/acuant/11.7.1/AcuantJavascriptWebSdk.min.js', - cameraSrc = '/acuant/11.7.1/AcuantCamera.min.js', + sdkSrc = `/acuant/${acuantVersion}/AcuantJavascriptWebSdk.min.js`, + cameraSrc = `/acuant/${acuantVersion}/AcuantCamera.min.js`, credentials = null, endpoint = null, glareThreshold = DEFAULT_ACCEPTABLE_GLARE_SCORE, From f5e94e7d0474682d9589ce80016fe777ad9b2757 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Tue, 20 Dec 2022 15:40:32 -0500 Subject: [PATCH 4/6] Fixing lints [skip changelog] --- spec/services/idv/steps/document_capture_step_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/services/idv/steps/document_capture_step_spec.rb b/spec/services/idv/steps/document_capture_step_spec.rb index febdd665427..574d372998a 100644 --- a/spec/services/idv/steps/document_capture_step_spec.rb +++ b/spec/services/idv/steps/document_capture_step_spec.rb @@ -42,7 +42,7 @@ let(:default_sdk_version) { IdentityConfig.store.idv_acuant_sdk_version_default } let(:alternate_sdk_version) { IdentityConfig.store.idv_acuant_sdk_version_alternate } - + subject(:step) do Idv::Steps::DocumentCaptureStep.new(flow) end From 83550cb8c53ba81b56d27aa024de332486f76ed0 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Tue, 20 Dec 2022 17:23:39 -0500 Subject: [PATCH 5/6] Revert "Acuant context should use config's acuant version by default" This reverts commit b4209981a0c98e642310064f133a1616d9c69736. [skip changelog] --- .../packages/document-capture/context/acuant.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/javascript/packages/document-capture/context/acuant.tsx b/app/javascript/packages/document-capture/context/acuant.tsx index b423f854e4d..d81d64c4f1a 100644 --- a/app/javascript/packages/document-capture/context/acuant.tsx +++ b/app/javascript/packages/document-capture/context/acuant.tsx @@ -1,6 +1,5 @@ import { createContext, useContext, useEffect, useState } from 'react'; import type { ReactNode } from 'react'; -import { getConfigValue } from '@18f/identity-config'; import useObjectMemo from '@18f/identity-react-hooks/use-object-memo'; import DeviceContext from './device'; import AnalyticsContext from './analytics'; @@ -193,15 +192,9 @@ const getActualAcuantCamera = (): AcuantCameraInterface => { return AcuantCamera; }; -/** - * The default version of the Acuant SDK to use, - * as specified in the application config - */ -const acuantVersion = getConfigValue('acuantVersion'); - function AcuantContextProvider({ - sdkSrc = `/acuant/${acuantVersion}/AcuantJavascriptWebSdk.min.js`, - cameraSrc = `/acuant/${acuantVersion}/AcuantCamera.min.js`, + sdkSrc = '/acuant/11.7.1/AcuantJavascriptWebSdk.min.js', + cameraSrc = '/acuant/11.7.1/AcuantCamera.min.js', credentials = null, endpoint = null, glareThreshold = DEFAULT_ACCEPTABLE_GLARE_SCORE, From a6a433b7c643e5d240f2e12a87d2f7920dff8780 Mon Sep 17 00:00:00 2001 From: eric-gade Date: Wed, 21 Dec 2022 10:56:05 -0500 Subject: [PATCH 6/6] Removing redundant condition (via @aduth) [skip changelog] --- app/services/idv/steps/document_capture_step.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/idv/steps/document_capture_step.rb b/app/services/idv/steps/document_capture_step.rb index c2fc84ec17b..7cd0cb343a2 100644 --- a/app/services/idv/steps/document_capture_step.rb +++ b/app/services/idv/steps/document_capture_step.rb @@ -45,7 +45,7 @@ def acuant_sdk_upgrade_a_b_testing_variables bucket = AbTests::ACUANT_SDK.bucket(flow_session[:document_capture_session_uuid]) testing_enabled = IdentityConfig.store.idv_acuant_sdk_upgrade_a_b_testing_enabled use_alternate_sdk = (bucket == :use_alternate_sdk) - if testing_enabled && use_alternate_sdk + if use_alternate_sdk acuant_version = IdentityConfig.store.idv_acuant_sdk_version_alternate else acuant_version = IdentityConfig.store.idv_acuant_sdk_version_default