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

Support federation requests in ruma-client #892

Open
jplatte opened this issue Feb 11, 2022 · 7 comments
Open

Support federation requests in ruma-client #892

jplatte opened this issue Feb 11, 2022 · 7 comments

Comments

@jplatte
Copy link
Member

jplatte commented Feb 11, 2022

Currently the API in ruma-client is only usable for client-server endpoints.

We should have a FederationClient (and maybe later an appservice one too) for non-CS requests.

@iinuwa
Copy link
Member

iinuwa commented Feb 11, 2022

Might this also require changes from #528?

@jplatte
Copy link
Member Author

jplatte commented Feb 11, 2022

Since ruma-client just sends requests and receives responses, no. Those changes would be for the side receiving the requests (and generating responses).

@ShadowJonathan
Copy link
Member

I think #894 could help with some version incompatibilities, should they rise up in the future.

@jplatte jplatte modified the milestones: 0.5.0, 0.6.0 Feb 18, 2022
@jplatte
Copy link
Member Author

jplatte commented Feb 18, 2022

Deferring this. I think in any case the Client only makes sense for the C2S API, if we want to support other APIs we may need a separate type like FederationClient.

@ShadowJonathan
Copy link
Member

👍 to a seperate FederationClient, I had some doubts with merging those two in the first place.

@jplatte jplatte removed their assignment Mar 16, 2022
@jplatte jplatte removed this from the 0.6.0 milestone Mar 16, 2022
@jplatte
Copy link
Member Author

jplatte commented Mar 16, 2022

Updated the issue description to describe separate client types. That makes this no longer a breaking change.

@ShadowJonathan
Copy link
Member

ShadowJonathan commented Jul 13, 2022

After discussing #894 a bit in the spec room, i think that the federation client needs to handle versioning differently than the normal client, as the primary intention for the federation api is to handle them in a fallback manner, retrying them with another version if the newest one isnt supported.

To make this easier, we could offer objects ("dialers") which could try each of these endpoints in-turn, returning control briefly to the callee before trying a new one, to either bail or alter the input. (Maybe something like ControlFlow could be used)

This could incorporate compat and future (see MSC3643) fallback mechanics, and allow server code to decide what to do based off of that.

Additionally, we could allow the callee to retrieve which endpoint the dialer had chosen in the end, to allow a subsequent call to quickly use that endpoint, before falling back to the normal sequence if it fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants