Closed paxcodes closed 1 year ago
I was about to merge, but when I run the tests locally make test
they are failing. Would you mind having a look.
Will do. Attempting to install using pipenv but pipenv is stuck on locking dev dependencies.
22 Apr 2023, 02:51 by @.***:
I was about to merge, but when I run the tests locally > make test> they are failing. Would you mind having a look.
— Reply to this email directly, > view it on GitHub https://github.com/sysid/sse-starlette/pull/53#issuecomment-1518582636> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/ADIDWNWDMMCNZHYBEUCGAATXCOSZ5ANCNFSM6AAAAAAXDRVZRU> . You are receiving this because you authored the thread.> Message ID: > <sysid/sse-starlette/pull/53/c1518582636> @> github> .> com>
@sysid This is ready for review. The change is more extensive as I ran into some issues when an event includes a comment. See PR description for more info.
Given 3 users who have made a comment on the ping events in #51 and #44 -- it might be best to send pings as comments by default, that way clients don't have to deal with them out-of-the box.
To achieve this, we can change the ping from an event data to an event comment as seen on this changeset,
However, the package does not seem to be encoding the events properly when a comment is included in the event. Examples,
ServerSentEvent(comment="a comment")
, then: a comment\r\n\r\n
: a comment\r\n
ServerSentEvent(data="some data", comment="a comment")
: a comment\r\ndata: some data\r\n\r\n
: a comment\r\n
If I understand the spec correctly (screenshot below) I think the expected data specified above is correct. Let me know otherwise! (from https://html.spec.whatwg.org/multipage/server-sent-events.html)
Testing
message
ordata