Skip to content

Commit 6aa18af

Browse files
authored
Fill in userId from alternate location (#126)
* Fill in userId from alternate location Verified that FIRAnalytics.setUserId caused a UserDimensions.UserProperty to be created but did not set UserDimensions.user_id. I filed a bug on the backend but this will protect users from the bug in the meantime. * Disable TSLint that conflicts between build environments * Add BUG messages
1 parent c1f0388 commit 6aa18af

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/providers/analytics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ export class UserDimensions {
147147
if (wireFormat.ltvInfo && wireFormat.ltvInfo.currency === 'USD') {
148148
this.ltvInUSD = wireFormat.ltvInfo.revenue;
149149
}
150+
151+
// BUG(36000368) Remove when no longer necessary
152+
/* tslint:disable:no-string-literal */
153+
if (!this.userId && this.userProperties['user_id']) {
154+
this.userId = this.userProperties['user_id'].value;
155+
}
156+
/* tslint:enable:no-string-literal */
150157
}
151158
}
152159

src/providers/database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class RefBuilder {
9292
resource: this.resource,
9393
dataConstructor,
9494
before: (event) => {
95+
// BUG(36000428) Remove when no longer necessary
9596
_.forEach(event.params, (val, key) => {
9697
event.resource = _.replace(event.resource, `{${key}}`, val);
9798
});

0 commit comments

Comments
 (0)