use-pusher icon indicating copy to clipboard operation
use-pusher copied to clipboard

Warn/Error when an event is un-handled

Open underfisk opened this issue 4 years ago • 3 comments

Months ago i opened an issue regarding the event handler not being invoked, that issue was half fixed but it was related to the fact that usePusher sometimes do not re-bind (when the component/dependencies re-render or its just simply not registered on pusher.js) What I would suggest is having a warning/error from usePusher when a pusher event is consumed on the client-side (via ws) but there are no handlers for it OR its simply not registered and it would help a lot debugging This feature could be enabled in dev only or via some kind of debugging flag and would help a lot in identifying some issues

underfisk avatar Feb 07 '21 15:02 underfisk

Please provide a codesandbox with this issue and I will look into it.

mayteio avatar Feb 09 '21 04:02 mayteio

I have a simple workaround for this, i have a middleware on Pusher.log method and i simply check if the message type includes callback not handled but its not so perfect, i think we can close this issue because you would end up doing the same or something similiar, sorry for the noise but i can share my implementation if you want

underfisk avatar Feb 09 '21 04:02 underfisk

Please share what you have 👍

mayteio avatar Feb 25 '21 03:02 mayteio