Closed wichert closed 4 years ago
Some background here: we use that to only react to routes if certain React components are mounted.
Related https://github.com/xmppjs/xmpp.js/issues/643
XMPP being stateful, is is very unusual to dynamically remove handlers. Usually it's your handler that would decide whether to trigger actions/changes or not.
It is specially true for iq
handlers as your application will change its contract "en route" and suddenly respond to them with a feature-not-implemented
error and it does not play well with Service Discovery.
I believe it is a bad practice and would really advise against it, however I'm not totally against allowing it.
@wichert could you elaborate on the use case?
@wichert ping?
Sorry for the late response. Your argument makes a lot of sense. I've already refactored our code to always have the plugin running.
We used to be able to unregister an iq callee route like so:
This is no longer possible with the new middleware setup.