diff --git a/dashboard/test/controllers/activities_controller_test.rb b/dashboard/test/controllers/activities_controller_test.rb index eec8d5283732b..98f519cabc09d 100644 --- a/dashboard/test/controllers/activities_controller_test.rb +++ b/dashboard/test/controllers/activities_controller_test.rb @@ -835,30 +835,6 @@ def build_try_again_response(options = {}) assert_equal_expected_keys expected_response, JSON.parse(@response.body) end - test 'sharing program with street address returns error' do - Geocoder.stubs(:find_potential_street_address).returns('1600 Pennsylvania Ave NW Washington DC') - - assert_does_not_create(LevelSource) do - post :milestone, - params: @milestone_params.merge( - script_level_id: @playlab_script_level.id, - course_id: @playlab_script.original_unit_group_id, - program: studio_program_with_text('1600 Pennsylvania Ave NW Washington DC') - ) - end - assert_response :success - - expected_response = { - 'level_source' => nil, - 'share_failure' => { - 'message' => "It looks like there is an address in it. Try changing the text.", - 'contents' => '1600 Pennsylvania Ave NW Washington DC', - 'type' => 'address' - } - } - assert_equal_expected_keys expected_response, JSON.parse(@response.body) - end - test 'sharing when gatekeeper has disabled sharing does not work' do Gatekeeper.set('shareEnabled', where: {script_name: @playlab_script.name}, value: false) diff --git a/lib/cdo/share_filtering.rb b/lib/cdo/share_filtering.rb index 31445aa2ec3d4..8ef1dc7e2ffa2 100644 --- a/lib/cdo/share_filtering.rb +++ b/lib/cdo/share_filtering.rb @@ -63,21 +63,8 @@ def self.find_share_failure(program, locale, project_type, exceptions: false) failure = find_email_or_phone_failure(program_text, exceptions: exceptions) return failure if failure - # Address: check each text block independently to prevent cross-block bleeding. - candidate = nil - texts.each do |text| - candidate = Geocoder.extract_address_candidate(text) - break if candidate - end - if candidate - address = Geocoder.find_potential_street_address(candidate) - if address - failure = ShareFailure.new(FailureType::ADDRESS, address) - raise PIIFilterException.new("Address PII Filter Violation", failure) if exceptions - return failure - end - end - + # Temporarily disable address filtering to prevent false positives. + # TODO: re-enable this when we improve the user experience of the address filter. find_profanity_failure(program_text, locale, {}, exceptions: exceptions) end diff --git a/lib/test/cdo/test_share_filtering.rb b/lib/test/cdo/test_share_filtering.rb index 02d7fce41636f..6d934d2d46daf 100644 --- a/lib/test/cdo/test_share_filtering.rb +++ b/lib/test/cdo/test_share_filtering.rb @@ -103,7 +103,7 @@ def test_extract_address_candidate assert_equal Geocoder::MAX_ADDRESS_WORDS, candidate.split.length end - def test_find_share_failure_with_street_address + def test_find_share_failure_temporarily_ignores_street_address Geocoder. stubs(:find_potential_street_address). returns('1600 Pennsylvania Ave NW, Washington, DC 20500') @@ -112,23 +112,8 @@ def test_find_share_failure_with_street_address 'My Street Address', '1600 Pennsylvania Ave NW, Washington, DC 20500' ) - assert_equal( - ShareFailure.new( - ShareFiltering::FailureType::ADDRESS, - '1600 Pennsylvania Ave NW, Washington, DC 20500' - ), - ShareFiltering.find_share_failure(program, 'en', 'playlab') - ) - - assert_equal( - ShareFailure.new( - ShareFiltering::FailureType::ADDRESS, - '1600 Pennsylvania Ave NW, Washington, DC 20500' - ), - assert_raises(PIIFilterException) do - ShareFiltering.find_share_failure(program, 'en', 'playlab', exceptions: true) - end.share_failure - ) + assert_nil ShareFiltering.find_share_failure(program, 'en', 'playlab') + assert_nil ShareFiltering.find_share_failure(program, 'en', 'playlab', exceptions: true) end def test_find_share_failure_with_phone_number