Skip to content
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

metamodel: Add information about whether a request/notification is sent from the client or the server #998

Closed
michaelpj opened this issue Jun 11, 2022 · 10 comments · Fixed by #1007
Labels
help wanted Issues identified as good community contribution opportunities

Comments

@michaelpj
Copy link
Contributor

This would be handy for implementations which treat these kinds of messages differently, e.g. the Haskell implementation uses this to make sure servers don't accidentally register handlers for messages that can't be sent to them.

@dbaeumer dbaeumer added this to the On Deck milestone Jun 13, 2022
@dbaeumer
Copy link
Member

Makes sense. PR welcome.

@dbaeumer dbaeumer added the help wanted Issues identified as good community contribution opportunities label Jun 13, 2022
@michaelpj
Copy link
Contributor Author

michaelpj commented Jun 13, 2022

Great. Just to sketch out the design before I do anything, would something like this be acceptable? Name bikeshedding welcome!

export type MethodSender = 'client' | 'server';

export type Request = {
  ...
  methodSender : MethodSender
  ...
}

export type Notification = {
  ...
  methodSender: MethodSender;
  ...
}

@michaelpj
Copy link
Contributor Author

Another option: MessageDirection = 'clientToServer' | 'serverToClient'

@dbaeumer
Copy link
Member

I would go for direction. We need to consider both as a possible value as well.

@michaelpj
Copy link
Contributor Author

Okay, sounds good to me. I'll leave both out for now since AFAIK no methods actually need it, but we can always add it later.

@dbaeumer
Copy link
Member

Progress can in principal go in both ways.

@michaelpj
Copy link
Contributor Author

Is it okay for me to just modify the metamodel? Is it still re-generated from the typescript sources?

@michaelpj
Copy link
Contributor Author

#1007

@michaelpj
Copy link
Contributor Author

Can we leave this open until the visitor is updated and the information is actually in the metamodel?

@michaelpj
Copy link
Contributor Author

Ignore me, you did it already! Very quick :)

@dbaeumer dbaeumer removed this from the On Deck milestone Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants