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

Left trim optional spaces in event field values #182

Merged

Conversation

zurab-darkly
Copy link
Collaborator

The SSE spec says that space(s) after a : when parsing event stream are optional. Currently shotgun requires one space. Here I trim these insignificant spaces to be compatible with the spec. SSE tests still pass because lasse appears to always send that optional space.

Copy link
Member

@elbrujohalcon elbrujohalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR!
Can you please add/amend the tests for this functionality?

@zurab-darkly
Copy link
Collaborator Author

@elbrujohalcon thanks for feedback and patience. I added some event parsing unit tests in 3d9ea47. How does that look?

Comment on lines 28 to 45
-spec init_per_suite(shotgun_test_utils:config()) ->
shotgun_test_utils:config().
init_per_suite(Config) ->
Config.

-spec end_per_suite(shotgun_test_utils:config()) -> shotgun_test_utils:config().
end_per_suite(Config) ->
Config.

-spec init_per_testcase(atom(), shotgun_test_utils:config()) ->
shotgun_test_utils:config().
init_per_testcase(_, Config) ->
Config.

-spec end_per_testcase(atom(), shotgun_test_utils:config()) ->
shotgun_test_utils:config().
end_per_testcase(_, Config) ->
Config.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all optional and they're not doing anything at all in this case. I would recommend just removing them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right of course, removed in 3a243ff. Thanks.

@elbrujohalcon elbrujohalcon merged commit ea3312f into inaka:master Mar 31, 2020
@zurab-darkly zurab-darkly deleted the fix-parse-event-optional-space branch March 31, 2020 08:03
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.

2 participants