Smack has problem in “Parses error sub-packets” with the following server IQ error stanza received from server.
I have applied below simple patches to temporary fix the problem. There are two issues with the code i.e.
- parser.getAttributeValue("", “type”) will return null
- Builder ‘condition’ cannot be null
Patches:
// Parse the error header
String errorType = parser.getAttributeValue("", "type");
if (StringUtils.isNullOrEmpty(errorType))
builder.setType(XMPPError.Type.CANCEL);
else
builder.setType(XMPPError.Type.fromString(errorType));
builder.setCondition(XMPPError.Condition.service_unavailable);
// builder.setType(XMPPError.Type.fromString(parser.getAttributeValue("", "type")));
builder.setErrorGenerator(parser.getAttributeValue("", "by"));
Smack Log:
05-25 14:05:56.590 7806-8403/org.atalk.android D/SMACK: RECV (0): <iq xmlns="jabber:client" id="962Pu-65" type="error" from="test5@marketing3.office.kontent.cc" to="test5@marketing3.office.kontent.cc/atalk">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="eu.siacs.conversations.axolotl.bundles:2087096589">
<item>
<bundle xmlns="eu.siacs.conversations.axolotl">
<signedPreKeyPublic signedPreKeyId="1">Bdwd5ViSrjuFnfQbj14JabfKhSbTo46fIijeoVhepBkO</signedPreKeyPublic>
<signedPreKeySignature>Cxg5vZmycyl4n0igT72k4N/6avtuWpE9/H0yiMTVcevgY2/deY4C0eFK/sryqWLsEpPJHr2r8h6IM4DTAUF/Cg==</signedPreKeySignature>
<identityKey>BZfHxn0pbsjIWr89/OXhGyww14jQCBxH1M0hTnaIqsUq</identityKey>
<prekeys>
<preKeyPublic preKeyId="1">Beq1AhaMs/hC+dq+fC94XOdR88D86ulnHaJ+2v3CFS4Q</preKeyPublic>
....
<preKeyPublic preKeyId="100">Bc8BJoEYHYCvOQMtW1n8hE4JHvK4cXmXtqpF/RIAZag9</preKeyPublic>
</prekeys>
</bundle>
</item>
</publish>
</pubsub>
<error code="503" />
</iq>