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
F2164019: D12536.id41598.diff
Mon, Jul 1, 10:10 PM
Unknown Object (File)
Sun, Jun 30, 2:07 AM
Unknown Object (File)
Sat, Jun 29, 11:30 PM
Unknown Object (File)
Fri, Jun 28, 4:47 PM
Unknown Object (File)
Thu, Jun 27, 5:19 PM
Unknown Object (File)
Thu, Jun 27, 1:13 PM
Unknown Object (File)
Wed, Jun 26, 9:09 PM
Unknown Object (File)
Wed, Jun 26, 5:40 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
Branch
device-token
Lint
No Lint Coverage
Unit
No Test Coverage

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 ↗(On Diff #41810)

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 ↗(On Diff #41810)