If field is updated by model action then model.cancel() doesn't cancel all changes

Defect/Issue Description:
If field is updated by model action then model.cancel() doesn’t cancel all changes

Environment:

  • API Version: v2
  • Release: Chicago
  • Release version: 14.4.11
  • Platform: Salesforce

Action Performed:
Using the XML provided, open it as a user.

  1. Save model changes (table should have 1 empty row)
  2. Enter ‘aaaa’ in Field1
  3. notice Field2 is updated by Model action to contain ‘test’
  4. Press the cancel button once.

Expected Result:
All changes (including Field2) to be cancelled/cleaned, so user can go to the last saved state of the model.

Actual Result:
Changes in Field2 are not cancelled, user has to press cancel button again.

Additional Resources:

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
	<models>
		<model id="UiModel" limit="20" query="true" datasource="Ui-Only" createrowifnonefound="true">
			<fields>
				<field id="Field1" displaytype="TEXT" length="255" label="Field1"/>
				<field id="Field2" displaytype="TEXT" length="255"/>
			</fields>
			<conditions/>
			<actions>
				<action>
					<actions>
						<action type="updateRow" fieldmodel="UiModel" affectedrows="context">
							<updates>
								<update valuesource="fieldvalue" field="Field2" enclosevalueinquotes="true" value="test"/>
							</updates>
						</action>
					</actions>
					<events>
						<event>row.updated</event>
					</events>
					<fields>
						<field>Field1</field>
					</fields>
				</action>
			</actions>
		</model>
	</models>
	<components>
		<skuid__table allowColumnFreezing="dragDrop" model="UiModel" uniqueid="sk-1O50-15088" mode="edit" showSaveCancel="true" pageSize="10" enableDrawers="false">
			<fields>
				<field id="Field1" label="{{Field1}}" uniqueid="fi-1O56-16788"/>
				<field id="Field2" uniqueid="fi-1O7y-20867"/>
			</fields>
			<filtering enableSearch="false"/>
			<actions/>
			<rowActions/>
			<massActions/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
			<drawer>
				<components>
					<skuid__table allowColumnFreezing="dragDrop" model="UiModel" uniqueid="sk-1O5O-21408" mode="read" showSaveCancel="false">
						<fields>
							<field id="Field1" label="{{Field1}}" uniqueid="fi-1O6c-11473"/>
							<field id="Field2" uniqueid="fi-1O6f-12447"/>
						</fields>
						<filtering enableSearch="false"/>
						<actions/>
						<rowActions/>
						<massActions/>
						<exportProperties useTableColumns="true"/>
						<sorting enable="false"/>
					</skuid__table>
				</components>
			</drawer>
		</skuid__table>
	</components>
	<resources>
		<labels/>
		<javascript/>
		<css/>
		<actionsequences/>
	</resources>
	<styles>
		<styleitem type="background" bgtype="none"/>
	</styles>
</skuid__page>

So, I don’t know if this a bug.

The reason it’s happening because model.cancel() trigger ‘row.updated’ event.

It kind of makes sense as the value in the field changed from a → b, though I expected row.updated to not be triggered by an ‘undo’ action.

I will leave it open for Skuid to confirm this, or just mark this answered.

Thank you

Follow up on previous comment. Am I right to believe that if the even was original triggered by cancel event and I’m looking at update event that the following parameters will be undefined:

  • modelHadPriorChanges
  • rowHadPriorChanges

Can someone please confirm that?

Thank you