Details
Details
- Reviewers
kamil - Commits
- rCOMM0a577e6b0879: [lib] Tunnelbroker support for unauthorized sessions
Test plan for D10829 was repeated for this diff, with the following test snippet (modified native/qr-code-screen.js):
const [deviceID, setDeviceID] = React.useState<?string>(); const { setUnauthorizedDeviceID } =useTunnelbroker(); const dispatch = useDispatch(); React.useEffect(() => { if (!deviceID) { return; } // 1. instantly start unauthorized session setUnauthorizedDeviceID(deviceID); console.log('SECONDARY DEVICE: setUseAnonymousSession', deviceID); // 2. after 5s fake login (switch to authorized session) setTimeout(async () => { console.log('SECONDARY DEVICE: faking login'); await commCoreModule.setCommServicesAuthMetadata( 'user', deviceID || 'foo', '123', ); dispatch({ type: setAccessTokenActionType, payload: '123' }); setUnauthorizedDeviceID(null); }, 5000); // 3. after 10s fake logout (don't switch to unauthorized session => disconnect) setTimeout(async () => { console.log('SECONDARY DEVICE: faking logout'); await commCoreModule.setCommServicesAuthMetadata('', '', ''); dispatch({ type: setAccessTokenActionType, payload: null }); setUnauthorizedDeviceID(null); }, 10000); return () => { setUnauthorizedDeviceID(null); }; }, [ setUnauthorizedDeviceID, deviceID, dispatch, ]);
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable