★ wanayoo — archive 1999 https://github.com/automaticmode/active_workflow/issues/7Nouvelle recherche | Portail wanayoo
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

Remote Agent API: empty strings in errors or logs cause errors #7

Open
MarcelPa opened this issue Jul 24, 2020 · 3 comments
Open

Remote Agent API: empty strings in errors or logs cause errors #7

MarcelPa opened this issue Jul 24, 2020 · 3 comments

Comments

@MarcelPa
Copy link

@MarcelPa MarcelPa commented Jul 24, 2020

Hey everyone,

I have found a rather odd error that will be raised when using remote agents via the remote agent API. If the remote agent responds to a check (maybe even a receive, I did not check that) with empty strings in the errors or logs, Active Workflow will throw an error: Exception during check. Validation failed: Message can't be blank. See this gist for the more details.

I have fixed it by removing all empty strings that would be returned in my remote agent. Still, this seems a little fragile to me on the Active Workflow side.

If this behaviour is intended, do not hesitate to close this issue. It may come in handy for anyone that encounters the same problem :-)

Cheers
Marcel

@vidas
Copy link
Member

@vidas vidas commented Jul 27, 2020

Hi @MarcelPa, thanks for submitting this issue.

This behavior is intended - mostly just to avoid ambiguity even if losing in ergonomics. But just to avoid surprises in the API and make necessary clarifications/changes I would like to ask for your opinion:
What was the expected behavior when returning empty strings? Should they be stored as empty log entries? Ignored? Something else?

This knowledge is very important because we plan to add support for structured logs in the near future, i.e. you will be able to log arbitrary hashes (dicts? maps?). There will be multiple cases similar to the one with empty strings and proper handling should go along user expectations.

As for general Remote Agent API fragility - there is room to grow, working on it (all the changes will be backward-compatible).

Thank you!
Vidas

@MarcelPa
Copy link
Author

@MarcelPa MarcelPa commented Jul 27, 2020 •

Hey @vidas , great question actually, I did not think about that.

I think I would prefer empty log entries to appear, which would have made me fixing me agent the way I did anyway. I can see that this would add ambiguity to the logs of ActiveWorkflow (especially in the case, where an ActiveWorkflow user is not equal to the developer of the remote agent). To find some middle ground: mention this behaviour in the RemoteAPI Docs and add a more explicit error message (as a Python dev, my time to find the actual problem was quite long :-D )

Structured logs sound interesting. Do you plan to add logging levels? I think that could make debugging agents in a production environment easier (again, thats a devs perspective).

Cheers
Marcel

@vidas
Copy link
Member

@vidas vidas commented Aug 25, 2020

Hi @MarcelPa.

Logging levels are already partially implemented - having log and error is one aspect of that, but I agree that a user should be able to select an arbitrary log level. More work is necessary on the frontend/API side of the thing to make use of the logging level. This is very much in the plans.

Thank you!
Vidas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.