grails-events-push icon indicating copy to clipboard operation
grails-events-push copied to clipboard

topic-* not being received by javascript listener

Open genuinefafa opened this issue 12 years ago • 3 comments

I'm working on a chat (to extend grailsTodo example) and wildcard topics are not being received by javascript but they are by the Service based listener.

You can check it on forkedGrailsTodo as of https://github.com/genuinefafa/grailsTodos/commit/914c3e4a3b4fd6898a434513bf9bc2fcfdf34eb7

genuinefafa avatar Jan 26 '13 23:01 genuinefafa

The problem is the lookup of the handler with the topic name of the event handlerMap[data && data.topic ... the same logic of regex that happens on the server should be done to retrieve the handlers on the javascript library. In the network view/ websocket channel, the messages arrive to the browser)

Another problem is the fact that you can subscribe to '*' and receive any browser pushed event! Is there a way to filter on the serverside to either disallow * subscription in order to have some security or have a way to evaluate a filter closure on clientconnection basis before sending it?

bfritscher avatar Feb 12 '13 20:02 bfritscher

@bfritscher I'm not really sure if what you said is related with the issue I'm describing... but, there is an interesting point the one you mention... What about subscribing to everything by using '*' as wildcar? I'm guessing it should not be allowed, or maybe do some server-side checking using a private hash... Anyways, my problem is something I wish we have the chance to solve.

I'm really loving the idea of pushed events :)

genuinefafa avatar Feb 13 '13 16:02 genuinefafa

I think I'm seeing the same problem, I believe I should be able to listen on:

grailsEvents.on("process-*", ...)

And receive all events such as "process-123". However, I only seem to receive events in the browser when I listen a a specific topic.

Looks like there are major changes coming so hopefully this will be addressed.

longwa avatar Oct 31 '13 22:10 longwa