Page MenuHomePhabricator

[lib] Basic implementation of identity search context provider without message sending
ClosedPublic

Authored by will on Feb 2 2024, 8:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Subscribers

Details

Summary

This implements a basic context provider which connects to the identity search service

Depends on D10928

Test Plan

flow and verified connection by writing some basic code on web utilizing context provider

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will retitled this revision from [lib] Basic implementation of identity search context provider without message sending to [lib] [2/n] Basic implementation of identity search context provider without message sending.Feb 2 2024, 8:40 PM
will edited the summary of this revision. (Show Details)

Remove lib/identity-search/identity-search.js

will requested review of this revision.Feb 2 2024, 9:00 PM
lib/identity-search/identity-search-context.js
64 ↗(On Diff #36600)

Was this accidentally left over?

68 ↗(On Diff #36600)

Should onclose be handled too?

105 ↗(On Diff #36600)

I guess these console.logs get replaced in later diffs?

will planned changes to this revision.Feb 5 2024, 7:42 AM
will retitled this revision from [lib] [2/n] Basic implementation of identity search context provider without message sending to [lib] [3/n] Basic implementation of identity search context provider without message sending.Feb 5 2024, 7:45 AM

addressed feedback and rebased to use modified flow types

lib/identity-search/identity-search-context.js
68 ↗(On Diff #36600)

Yeah. Addressed in latest diff

105 ↗(On Diff #36600)

Besides for the auth token console log which I just removed, Tunnelbroker also keeps these console logs.

Can you explain which of these console.logs are going to get removed in a later diff, versus which ones are meant to stay long-term?

All the console logs currently in the latest diff (36632) I plan to keep long-term.

will planned changes to this revision.Feb 5 2024, 11:50 AM

Let's strip the logs for things we expect to happen

We should also consider the dev environment. If we expect the calls to fail in the dev failure, then we should find a way to silence the logs. Guessing it should work fine with staging though, right?

lib/identity-search/identity-search-context.js
69 ↗(On Diff #36632)

I don't think we should keep this

109 ↗(On Diff #36632)

I don't think we should keep this

will retitled this revision from [lib] [3/n] Basic implementation of identity search context provider without message sending to [lib] [5/n] Basic implementation of identity search context provider without message sending.Feb 6 2024, 11:39 PM
will retitled this revision from [lib] [5/n] Basic implementation of identity search context provider without message sending to [lib] Basic implementation of identity search context provider without message sending.Feb 8 2024, 10:14 AM
ashoat added inline comments.
lib/identity-search/identity-search-context.js
110

Please make sure all lines are no longer than 80 chars (except where forced by Prettier)

115

You should add a space after the colon here

123

Shouldn't this be identitySearchMessageToServerTypes?

150

I assume you'll need to add a method later to enable a consumer of this context to send messages (ie. search queries) across the socket?

This revision is now accepted and ready to land.Feb 13 2024, 11:18 AM
lib/identity-search/identity-search-context.js
115

Actually not sure about this... how does console.log for native / web print two params? Does it already put some whitespace between them?

If no, please add a space in all of the relevant spots here. If yes, you can ignore this feedback

lib/identity-search/identity-search-context.js
115

console.log automatically adds whitespace when there are multiple params

lib/identity-search/identity-search-context.js
150

Yep! This happens in https://phab.comm.dev/D11000 which was already reviewed

lib/identity-search/identity-search-context.js
123

Yeah. Thanks for catching this

address feedback. Shorten line size and use server heartbeat type

[lib] rebase with identity search prefix and add auth message hook

will requested review of this revision.Feb 21 2024, 1:20 PM
will added a reviewer: atul.

Implementing the useGetIdentitySearchAuthMessage follows discussion from https://phab.comm.dev/D11059

Already reviewed this one – looks like @will wants a review from @atul based on history

lib/utils/identity-search-utils.js
12 ↗(On Diff #37415)

You don't need the question mark here

atul added inline comments.
lib/identity-search/identity-search-context.js
75 ↗(On Diff #37415)

Do we need any sort of validation here on the client side? Guessing there's validation on the identity service

This revision is now accepted and ready to land.Feb 22 2024, 7:52 PM
lib/identity-search/identity-search-context.js
75 ↗(On Diff #37415)

Yeah. It's mainly validation on the identity service which then sends a response back whether or not the authMessage was valid or not.