Page MenuHomePhabricator

[lib] create a hook to check if device is primary
ClosedPublic

Authored by kamil on Wed, Nov 27, 9:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 1, 11:36 PM
Unknown Object (File)
Sun, Dec 1, 7:07 AM
Unknown Object (File)
Sat, Nov 30, 4:47 PM
Unknown Object (File)
Sat, Nov 30, 1:37 PM
Unknown Object (File)
Wed, Nov 27, 3:22 PM
Unknown Object (File)
Wed, Nov 27, 3:22 PM
Unknown Object (File)
Wed, Nov 27, 3:22 PM
Unknown Object (File)
Wed, Nov 27, 3:22 PM
Subscribers

Details

Summary

The fact that this is asynchronous is painful but this is caused by ENG-8192.

Creatin hook to avoid code duplication

Test Plan

Log result and check if this works on primary and non-primary

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.Wed, Nov 27, 10:17 AM
kamil edited the summary of this revision. (Show Details)
bartek added inline comments.
lib/hooks/primary-device-hooks.js
22 ↗(On Diff #46100)

Alternatively, you can use await getContentSigningKey() from lib/utils/crypto-utils.js to get just deviceID and avoid relying on Identity context

This revision is now accepted and ready to land.Fri, Nov 29, 3:16 AM
lib/hooks/primary-device-hooks.js
22 ↗(On Diff #46100)

It's basically the same, but I prefer using getAuthMetadata() as this is what we use a lot more in the codebase. Overall, we should aim to get ENG-8192 done as a future solution.