Page MenuHomePhabricator

[native] helper to handle registration response
ClosedPublic

Authored by varun on Aug 16 2022, 8:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 2:34 PM
Unknown Object (File)
Sat, Oct 19, 1:23 AM
Unknown Object (File)
Sat, Oct 19, 1:23 AM
Unknown Object (File)
Sat, Oct 19, 1:23 AM
Unknown Object (File)
Sat, Oct 19, 1:23 AM
Unknown Object (File)
Sat, Oct 19, 1:19 AM
Unknown Object (File)
Oct 5 2024, 7:23 PM
Unknown Object (File)
Sep 30 2024, 2:43 AM

Details

Summary

I'm switching from looping through responses from the Identity service to having separate response handlers for each response type.

Depends on D4854

Test Plan

cargo build. this helper will be tested in a diff later in the stack that uses it

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun requested review of this revision.Aug 16 2022, 8:35 PM
tomek requested changes to this revision.Aug 17 2022, 6:25 AM
tomek added inline comments.
native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
207 ↗(On Diff #15697)

Shouldn't we take this by reference?

214–236 ↗(On Diff #15697)

Not sure if naming or logic is wrong, but something confusing is happening here. We start with pake_registration_finish, then we call pake_login_start and assign the result to client_registration_start_result and then create registration_request and send it through tx.

  1. Shouldn't we assign pake_login_start to e.g. client_login_start_result?
  2. Why do we create RegistrationRequest after calling pake_login_start?

Maybe this is correct, but I'm confused now.

This revision now requires changes to proceed.Aug 17 2022, 6:25 AM
varun added inline comments.
native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
207 ↗(On Diff #15697)

It's cheap to clone the Sender, because it's essentially a reference count increment

214–236 ↗(On Diff #15697)

Ah, yeah client_registration_start_result should be client_login_start_result.

RegistrationRequest in this context refers to the gRPC message struct, not the PAKE one. I know this is confusing, but I'm not sure what would make it clearer.

tomek added inline comments.
native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs
214–236 ↗(On Diff #15697)

Ok, makes sense! I think that it might be a good idea to have a code comment explaining that.

This revision is now accepted and ready to land.Aug 18 2022, 10:32 AM