Skip to content

Commit 044e2a3

Browse files
Jiaming Youmeta-codesync[bot]
authored andcommitted
Fixed early return bug of not calling _getClientIp
Summary: Fixed early return bug of not calling _getClientIp ___ overriding_review_checks_triggers_an_audit_and_retroactive_review Oncall Short Name: advertiser_experience_foundations Differential Revision: D104758535 fbshipit-source-id: df1b881546efda1acbbcc05f488e4d87d3eec55f
1 parent d7a66c7 commit 044e2a3

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

nodejs/capi-param-builder/src/ParamBuilder.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,31 +163,29 @@ class ParamBuilder {
163163
Constants.DEFAULT_1PC_AGE,
164164
this.etld_plus_1);
165165
}
166-
if (!new_fbc_payload) {
167-
this.cookies_to_set = Object.values(this.cookies_to_set_dict);
168-
return this.cookies_to_set;
169-
}
170-
// check if we should overwrite the fbc
171-
if (!this.fbc) {
172-
const drop_ts = Date.now();
173-
this.fbc = `fb.${this.sub_domain_index}.${drop_ts}.${new_fbc_payload}.${this.appendix_net_new}`;
174-
this.cookies_to_set_dict[Constants.FBC_NAME_STRING] = new CookieSettings(
175-
Constants.FBC_NAME_STRING,
176-
this.fbc,
177-
Constants.DEFAULT_1PC_AGE,
178-
this.etld_plus_1);
179-
} else {
180-
// extract payload
181-
const split = this.fbc.split('.');
182-
const old_fbc_payload = split[3];
183-
if (new_fbc_payload !== old_fbc_payload) {
166+
if (new_fbc_payload) {
167+
// check if we should overwrite the fbc
168+
if (!this.fbc) {
184169
const drop_ts = Date.now();
185-
this.fbc = `fb.${this.sub_domain_index}.${drop_ts}.${new_fbc_payload}.${this.appendix_modified_new}`;
170+
this.fbc = `fb.${this.sub_domain_index}.${drop_ts}.${new_fbc_payload}.${this.appendix_net_new}`;
186171
this.cookies_to_set_dict[Constants.FBC_NAME_STRING] = new CookieSettings(
187172
Constants.FBC_NAME_STRING,
188173
this.fbc,
189174
Constants.DEFAULT_1PC_AGE,
190175
this.etld_plus_1);
176+
} else {
177+
// extract payload
178+
const split = this.fbc.split('.');
179+
const old_fbc_payload = split[3];
180+
if (new_fbc_payload !== old_fbc_payload) {
181+
const drop_ts = Date.now();
182+
this.fbc = `fb.${this.sub_domain_index}.${drop_ts}.${new_fbc_payload}.${this.appendix_modified_new}`;
183+
this.cookies_to_set_dict[Constants.FBC_NAME_STRING] = new CookieSettings(
184+
Constants.FBC_NAME_STRING,
185+
this.fbc,
186+
Constants.DEFAULT_1PC_AGE,
187+
this.etld_plus_1);
188+
}
191189
}
192190
}
193191

0 commit comments

Comments
 (0)