Skip to content

Commit

Permalink
Update default standard parameters
Browse files Browse the repository at this point in the history
Summary: Remove fb_search_string, fb_status, fb_content_name, fb_content_category from default standard parameters

Differential Revision: D60362065

fbshipit-source-id: 56e48815e851bab04f04d17940062e1efb67b8f4
  • Loading branch information
Zilin Zhang authored and facebook-github-bot committed Jul 29, 2024
1 parent 8420de5 commit 83ba240
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ object ProtectedModeManager {
"fb_checkout_date",
"fb_city",
"fb_condition_of_vehicle",
"fb_content_category",
"fb_content_ids",
"fb_content_name",
"fb_content_type",
"fb_contents",
"fb_country",
Expand Down Expand Up @@ -75,9 +73,7 @@ object ProtectedModeManager {
"fb_region",
"fb_returning_arrival_date",
"fb_returning_departure_date",
"fb_search_string",
"fb_state_of_vehicle",
"fb_status",
"fb_suggested_destinations",
"fb_suggested_home_listings",
"fb_suggested_hotels",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.assertj.core.api.Assertions
import org.junit.Assert.assertTrue
import org.json.JSONArray
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.mockito.Mock
Expand Down Expand Up @@ -82,6 +83,152 @@ class ProtectedModeManagerTest : FacebookPowerMockTestCase() {
.thenReturn(mockFetchedAppSettings)
}

@Test
fun `test default standard params list`() {
val expectedParameters = hashSetOf(
"_currency",
"_valueToSum",
"fb_availability",
"fb_body_style",
"fb_checkin_date",
"fb_checkout_date",
"fb_city",
"fb_condition_of_vehicle",
"fb_content_ids",
"fb_content_type",
"fb_contents",
"fb_country",
"fb_currency",
"fb_delivery_category",
"fb_departing_arrival_date",
"fb_departing_departure_date",
"fb_destination_airport",
"fb_destination_ids",
"fb_dma_code",
"fb_drivetrain",
"fb_exterior_color",
"fb_fuel_type",
"fb_hotel_score",
"fb_interior_color",
"fb_lease_end_date",
"fb_lease_start_date",
"fb_listing_type",
"fb_make",
"fb_mileage.unit",
"fb_mileage.value",
"fb_model",
"fb_neighborhood",
"fb_num_adults",
"fb_num_children",
"fb_num_infants",
"fb_num_items",
"fb_order_id",
"fb_origin_airport",
"fb_postal_code",
"fb_predicted_ltv",
"fb_preferred_baths_range",
"fb_preferred_beds_range",
"fb_preferred_neighborhoods",
"fb_preferred_num_stops",
"fb_preferred_price_range",
"fb_preferred_star_ratings",
"fb_price",
"fb_property_type",
"fb_region",
"fb_returning_arrival_date",
"fb_returning_departure_date",
"fb_state_of_vehicle",
"fb_suggested_destinations",
"fb_suggested_home_listings",
"fb_suggested_hotels",
"fb_suggested_jobs",
"fb_suggested_local_service_businesses",
"fb_suggested_location_based_items",
"fb_suggested_vehicles",
"fb_transmission",
"fb_travel_class",
"fb_travel_end",
"fb_travel_start",
"fb_trim",
"fb_user_bucket",
"fb_value",
"fb_vin",
"fb_year",
"lead_event_source",
"predicted_ltv",
"product_catalog_id",

// AppCustomEventField list
"app_user_id",
"appVersion",
"_eventName",
"_eventName_md5",
/* duplicated _currency */
"_implicitlyLogged",
"_inBackground",
"_isTimedEvent",
"_logTime",
/* duplicated fb_order_id */
"_session_id",
"_ui",
/* duplicated _valueToSum */
"_valueToUpdate",
"_is_fb_codeless",
"_is_suggested_event",
"_fb_pixel_referral_id",
"fb_pixel_id",
"trace_id",
"subscription_id",
/* duplicated predicted_ltv */
"event_id",
"_restrictedParams",
"_onDeviceParams",
"purchase_valid_result_type",
"core_lib_included",
"login_lib_included",
"share_lib_included",
"place_lib_included",
"messenger_lib_included",
"applinks_lib_included",
"marketing_lib_included",
"_codeless_action",
"sdk_initialized",
"billing_client_lib_included",
"billing_service_lib_included",
"user_data_keys",
"device_push_token",
"fb_mobile_pckg_fp",
"fb_mobile_app_cert_hash",
"aggregate_id",
"anonymous_id",
"campaign_ids",

// AppEventsIgnoredParams List
"fb_post_attachment",
"receipt_data",

// List from dev doc
"ad_type",
"fb_content",
"fb_content_id",
/* duplicated fb_content_type */
/* duplicated fb_currency */
"fb_description",
"fb_level",
"fb_max_rating_value",
/* duplicated fb_num_items */
/* duplicated fb_order_id */
"fb_payment_info_available",
"fb_registration_method",
/* duplicated fb_search_string */
"fb_success",
"pm",
"_audiencePropertyIds",
"cs_maca"
)
assertEquals(expectedParameters, ProtectedModeManager.defaultStandardParameterNames)
}

@Test
fun `test null as parameters when enable and server return standard params list`() {
initMockFetchedAppSettings(mockStandardParamsFromServer)
Expand Down

0 comments on commit 83ba240

Please sign in to comment.