Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3529751
D9751.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9751.diff
View Options
diff --git a/keyserver/src/session/viewer.js b/keyserver/src/session/viewer.js
--- a/keyserver/src/session/viewer.js
+++ b/keyserver/src/session/viewer.js
@@ -147,7 +147,7 @@
}
}
- setDeviceToken(deviceToken: string) {
+ setDeviceToken(deviceToken: ?string) {
if (this.data.loggedIn) {
this.data = { ...this.data, deviceToken };
} else {
diff --git a/keyserver/src/updaters/device-token-updaters.js b/keyserver/src/updaters/device-token-updaters.js
--- a/keyserver/src/updaters/device-token-updaters.js
+++ b/keyserver/src/updaters/device-token-updaters.js
@@ -14,12 +14,15 @@
if (deviceType === undefined) {
throw new ServerError('invalid_parameters');
}
+ const { deviceToken } = update;
- viewer.setDeviceToken(update.deviceToken);
- await clearDeviceToken(update.deviceToken);
+ viewer.setDeviceToken(deviceToken);
+ if (deviceToken) {
+ await clearDeviceToken(deviceToken);
+ }
const setColumns = {};
- setColumns.device_token = update.deviceToken;
+ setColumns.device_token = deviceToken;
setColumns.platform = deviceType;
if (update.platformDetails) {
const { platform, ...versions } = update.platformDetails;
diff --git a/lib/types/device-types.js b/lib/types/device-types.js
--- a/lib/types/device-types.js
+++ b/lib/types/device-types.js
@@ -30,7 +30,7 @@
}
export type DeviceTokenUpdateRequest = {
- +deviceToken: string,
+ +deviceToken: ?string,
+deviceType?: DeviceType,
+platformDetails?: PlatformDetails,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 9:05 PM (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703172
Default Alt Text
D9751.diff (1 KB)
Attached To
Mode
D9751: [Flow202][lib][skip-ci] [26/23] Fix type error in DeviceTokenUpdateRequest
Attached
Detach File
Event Timeline
Log In to Comment