iOS GCM: CIQ settings (strings) do not accept +, %, < and > characters

iOS Garmin Connect Mobile: app settings (strings) do not accept +, %, < and > characters.

Environment
iOS 10.3.1 (iPhone)
Garmin Connect Mobile: 3.19

Description
Entering certain characters in CIQ app settings (string properties) causes unexpected behaviour. As far as I know, it doesn't matter which app you use, as long as it has a string setting.

The behaviour is slightly different for each of the characters.

"+": The string property is sucessfully saved (based on GCM's response and observed app behaviour), but when you re-enter the settings page, the "+" has been replaced with a space.
e.g. Original string: "1 + 2"
New string: "1 2"

"%": The string property is sucessfully saved (based on GCM's response and observed app behaviour), but when you re-enter the settings page, all settings are displayed with default values, including any other settings that had been previously and independently saved.
e.g. Original string: "10 % 3"
New string: Default Value

"<" and ">": The user is presented with a Connect IQ store webpage which says "Sorry, this page is currently unavailable". Settings are not saved (based on observed app behaviour). When you re-enter the settings page, all settings have their previous values.
e.g. Original string: "5 > 3"

All of these characters work fine in the simulator and Garmin Express.

Recreation procedure
In GCM, select an installed CIQ app that has a string setting. It would helpful if the app has more than one setting, in order to verify the behaviour for "%" where all settings are displayed with defaults after saving and re-entering the settings page.

Enter an example string in that field, and tap "Save". If desired, launch the app and verify the settings were actually saved (or not), as described above. (Settings should be saved for all chars except "<" and ">")

Repeat for each of the examples.

e.g. Training Notes:
https://apps.garmin.com/en-GB/apps/e...9-fe49891d7e76

Any one of the "Line" fields, which are strings, will exhibit the behaviour described above.
  • You may want to note a few more details, such as GCM version, iOS version, and a way to reproduce it . (see the sticky at the top of this forum)

    If this is an iOS thing (not GCM) I wouldn't count on it changing, but as a workaround, you could use "add" instead of +, "mod" instead of %, and lt/gt instead of < and >, etc.
  • Thanks. I have already edited my post with those details. And I already implemented the workaround you suggested in my app. I simply wanted to make Garmin aware of this issue.
  • If this is an iOS thing (not GCM) I wouldn't count on it changing,


    Maybe it can't be fixed, but at least the input string could be validated, in order to avoid surprising users and devs. And the same validation could be applied to all platforms.

    That might not happen, but it would be better than the current state where you can enter some characters on some platforms, but not others. At the very least it could be validated on iOS.

    Besides, I'm sure it isn't impossible to display/accept "<", ">", "+" and "%" in an iOS app that makes web requests. That kind of data is encoded in URLs and forms all the time. I'm guessing it's a quirk with the specific implementation, not an inherent limitation of the platform. Just like it isn't impossible for this forum to accept parentheses, slashes and who knows what else, in certain parts of posts -- it just doesn't happen to work right now.

    Whether there's impetus to fix it is a different matter.
  • I've got a ticket open to investigate. We will need to spend a little time reproducing this before it gets prioritized.

    Thanks,
    -Coleman
  • I'm circling back through issues on items that I was having issues reproducing. The original demonstration app is no longer in the store. Do you have another app that can reproduce this issue if it is still happening?

    Thanks,
    -Coleman
  • Looks like Training Notes is still in the store to me:
    https://apps.garmin.com/en-GB/apps/e...9-fe49891d7e76

    Besides, any app which uses strings for settings will exhibit this behaviour. Simply enter the problematic characters in a string setting field and you'll see the behaviour that was reported.

    If you can't use Training Notes for some reason, use my app, AppBuilder. Changing the "Label" field (as opposed to "Formula") might give you better results, since Label is free-form text, but Formula has to conform to a certain set of rules which have nothing to do with the bug report. Of course the configuration will be accepted, but the data field won't run as expected if Formula isn't valid. (Obv the validation is done at init time.)

    I picked Training Notes for the example since none of the text fields have any validation which would muddy the waters. You should be able to run the app no matter what text you enter.

    AppBuilder:
    https://apps.garmin.com/en-GB/apps/d...a-9b8485d2fc80
  • Okay, here's some explicit, unambiguous, step-by-step test cases using AppBuilder.
    https://apps.garmin.com/en-GB/apps/d...a-9b8485d2fc80

    I will use the "Label" and "Formula" fields, both strings, for the tests. Note the default settings are as follows:
    Label: AppBuilder
    Formula: Cadence / 2

    Base case (verify that string settings are working)
    - Change Label to "Random"
    - Save settings
    - Add AppBuilder data field to an activity (e.g. Run)
    - In activity, verify the label is "Random"
    - Re-enter settings page
    - Verify that Label is still "Random"

    Test case 1 ("+" is converted to space on read of settings)
    - Change Label to "Random2"
    - Change Formula to "2 + 2" and save settings. This is a valid setting for AppBuilder, but it triggers a bug in a GCM, when you re-read the settings (see below)
    - In the activity, verify that the data field displays a label of "Random2" and a value of "4" (so the settings were applied). (You need to restart the activity if it has already been started). Exit activity
    - Re-enter settings page
    Formula now appears as "2 2" ("+" has been converted to space, on read of settings)
    - Save settings again (without even changing anything)
    - Restart activity and verify that the data field displays "2" (in other words, not "4")

    Test case 2 ("%" causes settings to return to defaults, on read)
    - Change Label to "Random3"
    - Change Formula to "10 % 4"
    - Save settings
    - In the activity, verify the AppBuilder data field displays the label "Random3" and the value 2.
    - Open settings.
    Label will be displayed as "AppBuilder" and Formula will be "Cadence / 2", which are the app defaults. If you do not save these settings, the app will continue to correctly display "Random3" and "2". If you save these settings, the app will revert to the default label and formula as described above.

    Test case 3 ("<" and ">" are completely rejected)
    - Change Label to "Random4"
    - Change Formula to "10 - 4"
    - Save settings
    - In the activity, verify that the label is "Random4" and the value is 6. (Settings were applied correctly.)
    - Re-enter settings page
    - Change formula to "10 > 4".
    You will be presented with a Connect IQ store page with the error message "Sorry, this page is currently unavailable."
    - In the activity, verify the data field label is still "Random4" and the value is still 6.
    - In GCM, press "Back" and re-enter settings. Verify Label is still "Random4" and Value is still 6.

    I just did all of these tests with the latest GCM and iOS 11.0.3, as well as iOS 10.3.3.

    This could be a problem even with other generic apps like Training Notes. What if someone wants to add a note such as "Run at 80% of Max HR"? "Keep HR < 150?"
  • We've got some more movement on this by the GCM team while working on some other tickets. I will let you know when we have more info.

    Thanks,
    -Coleman