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

Fix escape characters of events when dry running #1715

Merged
merged 1 commit into from
Sep 30, 2016

Conversation

dsander
Copy link
Collaborator

@dsander dsander commented Sep 29, 2016

JSONEditor double escapes escape characters to properly display them in the UI, however when dry running Agents we actually need to send the Event's characters as they were.
Before an event containing new lines like this Line A\nLineB would be send as Line A\\nLineB to the backend. By replacing the double escaped slashes we ensure the event is handled as it would be when not dry running.

#1677

@albertsun
Copy link
Contributor

Ah! Great fix. +1

@cantino
Copy link
Member

cantino commented Sep 30, 2016

Good catch. Maybe a spec would be good to explain why this is needed?

JSONEditor double escapes escape characters to properly display them in the UI, however when dry running Agents we
actually need to send the Event's characters as they were.
Before an event containing new lines like this `Line A\nLineB` would be send as `Line A\\nLineB` to the backend. By
replacing the double escaped slashes we ensure the event is handled as it would be when not dry running.

 huginn#1677
@dsander
Copy link
Collaborator Author

dsander commented Sep 30, 2016

Added a spec, I initially wanted to do it in the rails5 PR because it already had dry run specs but it makes more sense to keep it in the right context.

@dsander dsander merged commit b4bf5c4 into huginn:master Sep 30, 2016
@dsander dsander deleted the fix-dry-run-event-escaping branch September 30, 2016 15:23
@cantino
Copy link
Member

cantino commented Sep 30, 2016

Nice :)

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.

None yet

3 participants