Page MenuHomePhabricator

[lib][web][native] set local Tunnelbroker device token on client
ClosedPublic

Authored by kamil on Fri, Jun 21, 2:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 5, 3:36 AM
Unknown Object (File)
Thu, Jul 4, 12:19 AM
Unknown Object (File)
Wed, Jul 3, 7:04 AM
Unknown Object (File)
Tue, Jul 2, 11:57 PM
Unknown Object (File)
Tue, Jul 2, 3:43 PM
Unknown Object (File)
Tue, Jul 2, 9:57 AM
Unknown Object (File)
Tue, Jul 2, 1:45 AM
Unknown Object (File)
Mon, Jul 1, 10:10 PM
Subscribers

Details

Summary

ENG-8400 and ENG-8348.

Discussed this with @inka, and we think it makes the most sense. The alternative is adding a new redux action only to set localToken and dispatch it whenever dispatching setDeviceTokenActionTypes.

Depends on D12527

Test Plan
  1. On web make sure that on each refresh device token is set
  2. On native make sure that on app open device token is set, on logout remains the same

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Fri, Jun 21, 2:46 AM
kamil edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Fri, Jun 21, 3:27 AM
lib/reducers/tunnelbroker-device-token-reducer.js
12–14

This pattern is confusing to me... in which cases do we expect action.payload to not be set? Is there a clearer way to differentiate between these two cases, eg. something like:

type SetDeviceTokenStartedPayload =
  | { +type: 'nothing_to_set' }
  | { +type: 'optimistically_set_device_token', +deviceToken: string }
  | { +type: 'clear_device_token' };
native/push/push-handler.react.js
536
lib/reducers/tunnelbroker-device-token-reducer.js
12–14

point 6 in ENG-8621

native/push/push-handler.react.js
536

point 4 in ENG-8621