Under Review
over 1 year ago

Bug: Elements in Settings-Array not editable->server error

Description:
When adding and saving array elements in settings using simulator, garmin connect iq app
or SDK IQ App (Properties.setValue)
the array elements are not editable in simulator or garmin connect iq app anymore.
Trying to edit then, leads to error messages.

SDK version: 6.2.2
IDE: eclipse 2022-03 (4.23.0) Linux

Steps to reproduce:
1. Create a new project (datafield) in eclipse
2. paste the settings.xml attached to resource/settings folder
3. choose in manifest: build target fr645m, target SDK Version 3.2x
4. start simulator (min. SDK version 3.2.x)
5. File->Edit Persistent Storage->Edit Application.Properties data
6. click on "add Item"
7. choose a activity type "Generic", enter values on other fields
8. click "save item"
9. click on "add Item"
10. choose a activity type "Running", enter values on other fields
11. click "save item"
12. properties show two array entries, one with activity Type "Generic", one with activitiy Type "Running"
13. click on "save"
14. notification dialog pops up, telling "Settings saved". click on "ok"
15. Close app settings editor (click on "close button")
16. open app settings editor (File->Edit Persistent Storage->Edit Application.Properties)
17. properties show the two array entries, but on both the element "activity type" is empty.
18. click on the editor (pencil) icon, leads to a error message

This affects not only the simulator, the behaviour in garmin connect iq app is equivalent.
I uploaded a test-app (beta) to test this, maybe it helps:
https://apps.garmin.com/de-DE/apps/fdfeada8-cf21-4a1d-a61c-1937be3d556f

settings.xml:

<resources>
	<properties>
		<property id="StreakActivity" type="array" />
	</properties>
	<settings>
		<setting propertyKey="@Properties.StreakActivity" title="Settings per activity" maxLength="4">
		    <setting title="activity type" type="number">
		        <settingConfig id="activityType" type="list">
		            <listEntry value="0">Generic</listEntry>
		            <listEntry value="1">Running</listEntry>
		            <listEntry value="2">Cycling</listEntry>
		            <listEntry value="3">Coding</listEntry>
		        </settingConfig>
		    </setting>

		    <setting title="string" prompt="string" type="string" >
		        <settingConfig id="string" type="alphaNumeric" errorMessage="error" required="true" />
		    </setting>
		    <setting title="number" prompt="number" type="number" >
		        <settingConfig id="number" type="numeric" errorMessage="error" required="true" />
		    </setting>
		    <setting title="boolean" prompt="boolean" type="boolean" >
		        <settingConfig id="boolean" type="boolean" errorMessage="error" required="true" />
		    </setting>
	
		    <defaults>
		        <entry>
		            <default id="activityType">1</default>
		            <default id="string">Oh, Hi there</default>
		            <default id="number">5</default>
		            <default id="boolean">true</default>
		        </entry>
		    </defaults>
		</setting>	    
	</settings>
</resources>