Skip to content

Commit f5b2c3f

Browse files
committed
Backport: COMPASS-132 Fix Intercom email can't be blank error (#534)
The below started appearing when intercom messenger was upgraded several weeks ago. The root cause is user resource would send `email:‘’` which fails validation on Intercom's API server. If we instead allow email to default to undefined, no empty string is sent to intercom’s server and validation passes. After this is merged, we’ll also need to change models/user.js in Compass. ``` Failed to load resource: the server responded with a status of 400 (Bad Request) Uncaught (in promise {"type":"error.list","request_id":"anscsvqg0eamtn7i98t0","errors":[{"cod e":"parameter_invalid","message":"Email can't be blank"}]} ```
1 parent 77bb403 commit f5b2c3f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"mongodb-explain-plan-model": "^0.2.0",
129129
"mongodb-extended-json": "^1.7.0",
130130
"mongodb-instance-model": "^3.1.6",
131-
"mongodb-js-metrics": "^1.5.0",
131+
"mongodb-js-metrics": "^1.5.2",
132132
"mongodb-language-model": "^0.3.3",
133133
"mongodb-ns": "^1.0.3",
134134
"mongodb-schema": "^5.0.0",

src/app/models/user.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ var User = Model.extend(storageMixin, {
2222
}
2323
},
2424
name: 'string',
25-
email: 'string',
25+
email: {
26+
type: 'any',
27+
default: undefined,
28+
required: false,
29+
allowNull: true
30+
},
2631
createdAt: 'date',
2732
lastUsed: 'date',
2833
avatarUrl: 'string',

0 commit comments

Comments
 (0)