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

Response tags not checked #234

Open
ThetaSinner opened this issue Feb 28, 2024 · 2 comments
Open

Response tags not checked #234

ThetaSinner opened this issue Feb 28, 2024 · 2 comments

Comments

@ThetaSinner
Copy link
Member

Through my exploration (read incompetence :)) I found that it's possible to get bad responses from Holochain that aren't caught by the client.

See what happened on holochain/hc-spin#3 (comment). Basically, calling Holochain 0.3 with a 0.2 client, which we know won't work but I'd have expected an error from the client.

I see that strings like 'clone_cell_created' aren't found in this project which is as deep as I've gone, but I believe that means the client isn't checking that Holochain responds to create_clone_cell with a message tagged with clone_cell_created. That means that deserialisation errors are passed back to the caller.

I think the Rust client will catch this because it deserializes to strict types. My question is whether the JS client should catch this? I'm thinking it should go ahead and throw an error with the contents of the response if it doesn't match. I'll post this in the API guild tomorrow because I think this behaviour should probably be something we decide on for clients in general.

@ThetaSinner
Copy link
Member Author

Ping @jost-s

@jost-s
Copy link
Contributor

jost-s commented Feb 29, 2024

Yes, I agree to include this in the client. I've been wanting to refactor the websocket implementation and typings and make it easier to read with less nested functions. This could be part of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants