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)
Fri, Nov 8, 10:36 PM
Unknown Object (File)
Fri, Nov 8, 1:30 PM
Unknown Object (File)
Fri, Nov 8, 12:24 PM
Unknown Object (File)
Fri, Nov 8, 12:24 PM
Unknown Object (File)
Sat, Oct 26, 5:09 AM
Unknown Object (File)
Sep 25 2024, 9:33 PM
Unknown Object (File)
Sep 25 2024, 9:33 PM
Unknown Object (File)
Sep 25 2024, 9:32 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.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 ↗(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)
lib/reducers/tunnelbroker-device-token-reducer.js
12–14 ↗(On Diff #41810)

point 6 in ENG-8621

native/push/push-handler.react.js
536 ↗(On Diff #41810)

point 4 in ENG-8621