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

Callback reply support #12

Merged
merged 8 commits into from
Jun 10, 2023
Merged

Callback reply support #12

merged 8 commits into from
Jun 10, 2023

Conversation

tatut
Copy link
Owner

@tatut tatut commented Jun 10, 2023

Support adding on-success and on-failure callbacks on the client side.

If an on-success is provided, the return value is sent to the client and the callback invoked with it. The return value of the server callback function must be serializable to JSON.

If an on-failure is provided, any throwable thrown during server callback invocation is caught and send to the client as a JSON object with message key containing the message and any context.

Added Playwright tests for both.

A callback to the backend can have a reply handler on the
frontend. This makes it more convenient to add things like indicators
that are running while processing is taking place.
Check both components and callbacks to consider a context empty.
Send success if return value is a map containing :ripley/success and
wrap that to backend callbacks. This prevents client from trying to
exfiltrate data by saying it has a handler even when one wasn't intended.
@tatut tatut merged commit b7f94fb into master Jun 10, 2023
@tatut tatut deleted the callback-reply branch June 10, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant