Skip to content

Commit c479118

Browse files
committed
remove check for reserved user property names
1 parent 254148e commit c479118

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

src/components/ga4/EventBuilder/ValidateEvent/handlers/formatCheckLib.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@ import sizeof from "object-sizeof"
44
import {eventDefinitions} from "../schemas/eventTypes/eventDefinitions"
55
import {InstanceId} from "../../types"
66

7-
const RESERVED_USER_PROPERTY_NAMES = [
8-
"first_open_time", "first_visit_time", "last_deep_link_referrer", "user_id",
9-
"first_open_after_install"
10-
]
11-
127
// formatCheckLib provides additional validations for payload not included in
138
// the schema validations. All checks are consistent with Firebase documentation.
149
export const formatCheckLib = (payload: any, instanceId: InstanceId, api_secret: string, useFirebase: boolean) => {
1510
let errors: ValidationMessage[] = []
1611

1712
const appOrClientErrors = isValidAppOrClientId(payload, useFirebase)
18-
const userPropertyNameErrors = isValidUserPropertyName(payload)
1913
const currencyErrors = isValidCurrencyType(payload)
2014
const emptyItemsErrors = isItemsEmpty(payload)
2115
const itemsRequiredKeyErrors = itemsHaveRequiredKey(payload)
@@ -26,7 +20,6 @@ export const formatCheckLib = (payload: any, instanceId: InstanceId, api_secret:
2620
return [
2721
...errors,
2822
...appOrClientErrors,
29-
...userPropertyNameErrors,
3023
...currencyErrors,
3124
...emptyItemsErrors,
3225
...itemsRequiredKeyErrors,
@@ -82,25 +75,6 @@ const isValidAppOrClientId = (payload: any, useFirebase: boolean) => {
8275
return errors
8376
}
8477

85-
const isValidUserPropertyName = (payload: any) => {
86-
const errors: ValidationMessage[] = []
87-
const userProperties = payload.user_properties
88-
89-
if (userProperties) {
90-
Object.keys(userProperties).forEach(prop => {
91-
if (RESERVED_USER_PROPERTY_NAMES.includes(prop)) {
92-
errors.push({
93-
description: `user_property: '${prop}' is a reserved user property name`,
94-
validationCode: "value_invalid",
95-
fieldPath: "user_property"
96-
})
97-
}
98-
})
99-
}
100-
101-
return errors
102-
}
103-
10478
const isValidCurrencyType = (payload: any) => {
10579
const errors: ValidationMessage[] = []
10680

0 commit comments

Comments
 (0)