scripts/pubsub_createdelete.scs

Thu, 23 Mar 2023 12:14:53 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Mar 2023 12:14:53 +0000
changeset 172
2c17151ed21b
parent 36
b1d7a274d250
permissions
-rw-r--r--

client: Fix timeout handling

Previously, the timeout handler would fire an error that would get caught and
logged by the timer code. However that error never reached the upper levels of
scansion, leading to the whole thing just hanging.

Now we just trigger resumption of the async runner, and throw the error from
there if we haven't received the stanza yet.

With this change, timeouts are now correctly handled and reported as failures.

[Client] Romeo
	jid: admin@localhost
	password: password

// admin@localhost is assumed to have node creation privileges

---------

Romeo connects

Romeo sends:
	<iq type="set" to="pubsub.localhost">
		<pubsub xmlns="http://jabber.org/protocol/pubsub">
			<create node="princely_musings"/>
		</pubsub>
	</iq>

Romeo receives:
	<iq type="result"/>

Romeo sends:
	<iq type="set" to="pubsub.localhost">
		<pubsub xmlns="http://jabber.org/protocol/pubsub">
			<create node="princely_musings"/>
		</pubsub>
	</iq>

Romeo receives:
	<iq type="error">
		<error type="cancel">
			<conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
		</error>
	</iq>

Romeo sends:
	<iq type="set" to="pubsub.localhost">
		<pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
			<delete node="princely_musings"/>
		</pubsub>
	</iq>

Romeo receives:
	<iq type="result"/>

Romeo sends:
	<iq type="set" to="pubsub.localhost">
		<pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
			<delete node="princely_musings"/>
		</pubsub>
	</iq>

Romeo receives:
	<iq type="error">
		<error type="cancel">
			<item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
		</error>
	</iq>

Romeo disconnects

// vim: syntax=xml:

mercurial