r3labs/sse

Multiple rows of data produce the wrong data format when processing event

Closed this issue · 2 comments

Hi, when I listen to the Subscribtions event,I received the wrong data . It should be JSON format.
Is there something wrong in the func processEvent ? ( ps : client.go:287)
The origin data is as follow:

:
id: urn:uuid:04d6eadc-c270-406c-99c9-f6ce93499db6
data: {
data:   "@context": "https://mercure.rocks/",
data:   "id": "/.well-known/mercure/subscriptions/%2Fstarship%2Faa%2F%7Bevent%7D/urn%3Auuid%3A9605f26e-b6e7-4a36-a0cf-4126ef44647b",
data:   "type": "Subscription",
data:   "subscriber": "urn:uuid:9605f26e-b6e7-4a36-a0cf-4126ef44647b",
data:   "topic": "/starship/aa/{event}",
data:   "active": false,
data:   "payload": {
data:     "cluster_code": "aa"
data:   }
data: }

And the data I got is:

}  }    "cluster_code": "aa"  "payload": {  "active": false,  "topic": "/starship/aa/{event}",  "subscriber": "urn:uuid:9605f26e-b6e7-4a36-a0cf-4126ef44647b",  "type": "Subscription",  "id": "/.well-known/mercure/subscriptions/%2Fstarship%2Faa%2F%7Bevent%7D/urn%3Auuid%3A9605f26e-b6e7-4a36-a0cf-4126ef44647b",  "@context": "https://mercure.rocks/",{

Hey @jalen-qian

Sorry for the delay in getting back to you!

Not sure if this is still useful for you, but this should now be resolved in v2.3.3.

Hey @purehyperbole That's great! You solved my problem. Thank you!