Page MenuHomePhabricator

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

Authored by kamil on Jun 21 2024, 2:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 2:56 PM
Unknown Object (File)
Mon, Dec 23, 2:56 PM
Unknown Object (File)
Mon, Dec 23, 2:55 PM
Unknown Object (File)
Mon, Dec 23, 2:55 PM
Unknown Object (File)
Fri, Dec 13, 4:25 AM
Unknown Object (File)
Nov 26 2024, 3:30 AM
Unknown Object (File)
Nov 26 2024, 12:09 AM
Unknown Object (File)
Nov 8 2024, 10:36 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.Jun 21 2024, 2:46 AM
kamil edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jun 21 2024, 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