Menu

#47 event counts are inappropriately cleared somehow

3.x
open
nobody
5
2014-08-12
2007-07-04
No

we are getting the first catch from this test,
(test originally by Matthew Henry) twice, before
the count="2" path gets chosen the THIRD TIME
instead of the second:

<vxml xmlns="http://www.w3.org/2001/vxml" version = "2.1">

<form id="F1">

<catch cond="false" event="MyUserDefinedEvent">
<prompt>
since the condition attribute is not true,
this handler will not get executed.
</prompt>
</catch>

<catch cond="true" count="1" event="MyUserDefinedEvent">
<prompt>since the condition attribute is true, this
handler will get executed.</prompt>
<goto nextitem="B_2"/>
</catch>

<catch cond="true" count="2" event="MyUserDefinedEvent">
<prompt>this must be the second time this error
has been caught. the thrown message is
<value expr="_message"/>.</prompt>
</catch>

<!-- Location L (see below) -->

<block name="B_1">
<prompt>getting ready to throw an event to be caught.</prompt>
<throw event="MyUserDefinedEvent"/>
</block>

<block name="B_2">
<throw event="MyUserDefinedEvent" message="'here is the message'"/>
</block>
</form>
</vxml>

VXML2.0 spec 5.2.2 states that event counts are
only cleared when entering a form, _NOT_ when doing
a formitem->formitem transition within a form. I thought that when I commented out the following three lines of void VXI::CollectPhase that would fix it,
but it did not.

// Clear the event counts if we're collecting from a different form item
// this is incorrect. according to VXML2.0:5.2.2, event counts
// are cleared on form (re)entry, not item transition.
// vxistring itemname;
// form.GetAttribute(ATTRIBUTE__ITEMNAME, itemname);
// exe->eventcounts.ClearIf(itemname, false);

There's a second bug, which is: when the <form id="F1">
tag is moved to location L, openVXI complains that
the nextitem is "not a local reference" which is in violation of "as-if-by-copy" semantics. It does
this immediately, masking the other bug.

Discussion


Log in to post a comment.