Closed eager-seeker closed 4 years ago
Workaround in case it helps: The scenario above can be avoided simply by including an explicit resource in each jid before sending messages, that will be known when creating templates. e.g. agent0@localhost/dummyresource
Yes. Resources is an XMPP feature with which we have to deal. Maybe in next releases we could just work always with bare jids transparently.
Closing as workaround of adding explicit resources works ok.
Description
When trying to use templates to match by sender jid, when using Prosody, random resource assignment seems to scupper the matching.
What I Did
I tried running 2 agents in different processes to force them to communicate via Prosody. There seemed no way to get template matching to work against sender jid, as the client was receiving messages with a random jid resource added:
Expected a match for the message, instead, get:
Noting the resource being added to the "from" jid, I tried debugging aioxmpp to see did it add it somewhere between send and receive, but it would appear not. In Prosody configuration, I see a setting that might add such a resource, but the default sounds fine. Explicitly setting to "kick_old" didn't seem to help: "conflict_resolve - How to resolve resource conflicts. May be "random" (assign a random resource), "increment" (append a unique integer to the resource), "kick_new" (deny the new connection), "kick_old" (disconnect the existing session). Default is "kick_old"."