Page MenuHomePhabricator

[Flow202][lib][skip-ci] [26/23] Fix type error in DeviceTokenUpdateRequest
ClosedPublic

Authored by ashoat on Nov 7 2023, 10:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 8:18 AM
Unknown Object (File)
Fri, May 3, 8:24 PM
Unknown Object (File)
Thu, May 2, 6:08 PM
Unknown Object (File)
Mon, Apr 29, 8:53 AM
Unknown Object (File)
Sat, Apr 27, 8:23 AM
Unknown Object (File)
Thu, Apr 25, 12:46 AM
Unknown Object (File)
Mon, Apr 22, 3:35 PM
Unknown Object (File)
Sun, Apr 21, 9:53 AM
Subscribers

Details

Summary

The Flow upgrade surfaced an issue here. setDeviceToken and setDeviceTokenFanout in device-actions.js currently have type errors due to passing a nullable deviceToken (?string) to DeviceTokenUpdateRequest, which requires a non-nullable string.

Since the input validator already accepted a nullable string, I decided to update the Flow type. I also made some accompanying changes to the endpoint on the keyserver side.

I considered an alternative where setDeviceToken skips calling keyservers if the input is falsey, but I decided against that because I think there is some value to being able to clear a deviceToken from a keyserver.

NOTE: CI will fail on this diff. I considered the possibility of fixing Flow errors BEFORE upgrading Flow, but it wasn't possible... in some cases, the fixes to support the new version of Flow caused errors in the old version. I could have hidden these type errors with $FlowFixMe lines and then later revert those, but that seemed like too much busy work.

Depends on D9749

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 7 2023, 10:54 AM
Harbormaster failed remote builds in B23883: Diff 32916!
This revision is now accepted and ready to land.Nov 8 2023, 6:01 AM
ashoat retitled this revision from [Flow202][lib] [26/23] Fix type error in DeviceTokenUpdateRequest to [Flow202][lib][skip-ci] [26/23] Fix type error in DeviceTokenUpdateRequest.Nov 19 2023, 4:59 PM
This revision was landed with ongoing or failed builds.Nov 27 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.