Problem with my watch face update not resetting values?

I did an update to my watch face where I changed the properties, settings, and strings. The problem is that after my watch updated to the correct version of the watch face, it retained some of the old properties instead of the intended defaults. Now when users update to the current version they'll get different settings which neither of us wanted.

Also, one of the properties, the app version, is the old version. I had to change some of the other properties because of some new features I added; and I added them in settings.

Why didn't it change it to the properties that I wanted? Thanks.

Top Replies

All Replies

  • You need to be more specific. Can you give example(s) to each type of problem? It's not clear, but i guess is that you had property x with default value "x" and you installed this (the old version), so x was saved as value, and now you kept the property name x but changed it's DEFAULT value to "y" and you still see it's value is "x"? If I'm right then this is the correct behaviour and there's a question about it every month or two. You can search the forum for more explanations. If i didn't guess right then clarify the problem you face.

  • It sounds like you understand the problem. How am I supposed to have their settings changed to the default of the current version? How are I supposed to search for this problem?

  • If you have version 1 installed with "prop1" defaulting to "1", and in version 2 have "prop1" defaulting to "2", "prop1" will be what was the default of "1".  If the user had changed "prop1" to "3", it will remain as "3".  If you want the default to be "2", instruct the user to uninstall and reinstall.  Another option is add "prop2" in the new version and have your app use "prop2" instead of "prop1"

  • How am I supposed to have their settings changed to the default of the current version?

    You could leverage the app version that you stored in properties. When your app runs, if the version property is equal to the old version, you can programmatically set new values. You could even apply logic which only changes certain values (e.g. app version property, any properties which are equal to their previous default value.)

    Of course this means you'd have to hardcode your defaults a 2nd time in the app code. (There's other situations where that kind of thing is necessary anyway. At least in the past, if the user entered an invalid vaue for any setting, all settings would be returned as null. The app would have to handle this case, and the typical approach would be to use defaults.)

    Why didn't it change it to the properties that I wanted?

    Because a property's default value is only applied when that property exists. One way it could work is that when the user installs an app, the system applies defaults and saves all the properties. Afterwards, defaults are never applied again to existing properties (unless the user uninstalls and installs the app.)

    The alternative is that the system would just re-apply a default value whenever you change it in the app. Why wouldn't the system do this?

    1) it's more complex behavior. what algorithm should the system use to decide whether to re-apply a default? should it only apply defaults for properties which were equal to their previous default value? or should it apply defaults for all properties?

    2) it may be surprising to the user. (say the user explicitly selected the default value after changing it to something else. they probably expect that value to stick, in most cases). As a user I don't expect all my settings to change just because I installed a new app version

    3) it may be surprising to the developer

    To me it seems like they chose the simplest behavior which follows the principle of least surprise.

  • I do think Jim's suggested approach is much simpler: just create new properties for anything that requires a new default.