-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidating ClientService
and js-ws and js-rpc integration
#560
Conversation
1073582
to
1ebcd20
Compare
Remember to review #559. However if this is consolidating, @tegefaulkes how come there isn't any deleted files in the diff right? I thought files would be moved from somewhere else. |
ClientService
consolidationClientService
and js-ws and js-rpc integration
No deletions yet, it's mostly consolidating the client into a However if we're using the |
1ebcd20
to
6903126
Compare
@addievo add yourself to the |
@amydevs make sure to push often here even for intermediate commits. |
Client service will require an empty stream handler for the ClientServiceClient, as this behaviour is currently unexpected and will cause creation of unneeded resources. When we decide to add push notifs, etc. We can replace this with handlers for that. |
Just immediately close the stream as soon as you get the event. For now server shouldn't be creating streams. But we will make use of this feature later in the future. |
1ba27a4
to
0b66bac
Compare
Has this been rebased on #560? |
f2064f5
to
883fbbf
Compare
debf777
to
44609b9
Compare
883fbbf
to
68233c2
Compare
This is the main PR to work on now. Goals:
I can see that there are branch conflicts in this PR... I thought this was rebased? |
@amydevs please rebase this on top of staging too. |
It was rebased, but a linting commit in staging brought in a bunch of conflicts. They'll be mostly whitespace but git doesn't fully understand that. |
Make them both hardcoded or both paramaterised but defaulted? |
Easiest way is to bind this back for the generator functions. |
[ci skip]
[ci skip]
All but 1 test fixed now. [ci skip]
Did you make both |
I'm not sure this makes sense to me. I just asked chatgpt... The constructor binding approach generally won't work if you define the async generator function as a class field, like Here's an example to demonstrate: class MyClass {
constructor() {
this.handle = this.handle.bind(this); // This line is essentially a no-op
}
handle = async function*() {
// `this` is already bound to the class instance because of the class field initialization
}
} In this case, the So, if you're using class fields to define your async generator function, you don't need to worry about binding |
On second thought... chatgpt might be wrong here. You are correct, and I apologize for the earlier error. The constructor binding is indeed effective when using class field syntax with When you define a method as a class field like Binding the function in the constructor would ensure that class MyClass {
constructor() {
this.handle = this.handle.bind(this);
}
handle = async function*() {
// `this` is now correctly bound to the class instance
}
} In this example, explicitly binding |
I fixed that by doing the binding when registering the handler inside the |
Fixed idGen usage in `PolykeyClient` and imports in `PolykeyAgent`
|
I'm skipping squashing here. This has been merged into and I don't want any potential problems. |
The |
New issue #565. |
Description
In this PR we're consolidating the client service logic into a
ClientService
class that handles its life cycle.Issues Fixed
Tasks
PolykeyAgent.clientServiceHost
,PolykeyAgent.clientServicePort
,PolykeyAgent.agentServiceHost
,PolykeyAgent.agentServicePort
as getter property so that they can be used directly instead of referring to encapsulated objects for the host and port.Final checklist
Squash and rebased