Page MenuHomePhabricator

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

Authored by kamil on Nov 27 2024, 9:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 1, 2:46 PM
Unknown Object (File)
Tue, Dec 31, 11:29 AM
Unknown Object (File)
Tue, Dec 31, 3:00 AM
Unknown Object (File)
Mon, Dec 30, 1:48 AM
Unknown Object (File)
Mon, Dec 30, 12:56 AM
Unknown Object (File)
Sat, Dec 28, 12:55 PM
Unknown Object (File)
Sat, Dec 28, 10:44 AM
Unknown Object (File)
Sat, Dec 28, 4:07 AM
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.Nov 27 2024, 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.Nov 29 2024, 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.