Hey, i'm trying to figure out how to get my EventS...
# javascript
m
Hey, i'm trying to figure out how to get my EventSource#onmessage function to work. My current code looks like this:
Copy code
eventSource = EventSource("/api/sse/$authenticationToken")

eventSource!!.onmessage = { event ->
    console.log("here")
    event.handleMessageEvent(userGS) // not of interest here
}
when looking into the Network Log, i can see that the browser does receive the data and interprets it right. (I haven't used the 'id' field) But the console.log function does not print anything (onmessage isn't beeing triggerd). btw: the EventSource#onopen works perfectly fine I don't really have information i could provide as I don't know what could be helpful. ~ Moritz
For everyone wondering what was wrong: You have to set the
event
field in SSE to "message"