Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No API to remove an iq callee route #779

Closed
wichert opened this issue Sep 27, 2019 · 4 comments
Closed

No API to remove an iq callee route #779

wichert opened this issue Sep 27, 2019 · 4 comments

Comments

@wichert
Copy link
Contributor

wichert commented Sep 27, 2019

We used to be able to unregister an iq callee route like so:

this.plugins['iq-callee'].setters.delete(xmlns)

This is no longer possible with the new middleware setup.

@wichert
Copy link
Contributor Author

wichert commented Sep 27, 2019

Some background here: we use that to only react to routes if certain React components are mounted.

@sonnyp
Copy link
Member

sonnyp commented Sep 27, 2019

Related #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?

@sonnyp
Copy link
Member

sonnyp commented Oct 3, 2019

@wichert ping?

@wichert
Copy link
Contributor Author

wichert commented Oct 4, 2019

Sorry for the late response. Your argument makes a lot of sense. I've already refactored our code to always have the plugin running.

@wichert wichert closed this as completed Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants