javipalanca / spade

Smart Python Agent Development Environment
MIT License
258 stars 98 forks source link

Presence Example #116

Open DevPy129387 opened 8 months ago

DevPy129387 commented 8 months ago

Description

I tried example "presence_subscribe_friends.py". I get an error and the agents don't finish properly, so I can't start it again. May I get some advise to fix it?

What I Did

Output after first run:

Agent agent24 running
Agent agent13 running
[agent24] Agent agent13 asked for subscription. Let's aprove it.
[agent13] Agent agent24 has accepted the subscription.
[agent13] Contacts List: {JID(localpart='agent24', domain='lap-w10p552.ast.intern', resource=None): {'subscription': 'to'}}
[agent13] Agent agent24 is available.
[agent13] Agent agent24 is available.
[agent13] Agent agent24 asked for subscription. Let's aprove it.
[agent24] Agent agent13 has accepted the subscription.
[agent24] Contacts List: {JID(localpart='agent13', domain='lap-w10p552.ast.intern', resource=None): {'subscription': 'both'}}
[agent24] Agent agent13 is available.
[agent24] Agent agent13 is available.
unhandleable IQ request: from=JID(localpart=None, domain='...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x0000018E8CB8FA00>
unhandleable IQ request: from=JID(localpart=None, domain='...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x0000018E8CB8F880>

Output after second run:

Agent agent24 running
[agent24] Agent agent13 is available.
Agent agent13 running
unhandleable IQ request: from=JID(localpart=None, domain=...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x000001EE81D8E110>
unhandleable IQ request: from=JID(localpart=None, domain='...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x000001EE81D8FCA0>
DevPy129387 commented 8 months ago

I fixed it with adding

            await asyncio.sleep(10)
            await self.agent.stop()

into the run-loop of both behaviours. But I still get

unhandleable IQ request: from=JID(localpart=None, domain='...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x000002ADA70CC7C0>
unhandleable IQ request: from=JID(localpart=None, domain='...', resource=None), type_=<IQType.GET: 'get'>, payload=<aioxmpp.version.xso.Query object at 0x000002ADA70CC640>

What does this mean?