[CIBQBUG]AppBase.setProperty

Former Member
Former Member
I think I found a bug.
If I call AppBase.setProperty with a value of type dictionary, where the dictionary has keys of type symbol, then I get an exception.

According to documentation this should be allowed.

function onStop() {
self.setProperty("Works", {"test" => 1});
self.setProperty("Bug", {:test => 1});
}
  • I think this is user error. The documentation that I'm looking at doesn't indicate that symbols are allowed.

    Using a key, store the given data in the object by calling setProperty(). Keys can be of type String, Number, Float, and Boolean. Values can be of type String, Number, Float, Boolean, null, and Arrays or Dictionaries containing those types. There is a limit on the size of the Properties of 8KB. If you reach this limit, the properties will not be saved or reloaded.
  • Travis is correct. Symbols and Classes are not allowed to be used in the object store. We hope to provide this functionality in the future but for now you have to stick with the Native types listed in the documentation.
  • Former Member
    Former Member over 10 years ago
    I think this is user error. The documentation that I'm looking at doesn't indicate that symbols are allowed.


    A dictionary with elements of type Number complies with that description. Nowhere does it say what the type of the key should be. Dictionaries allow the keys to be of type symbol...
    But if it's not supported, it's not supported. I can work around that.
  • The valid types for keys are listed in the documentation Travis quoted, right before the bold part. It sounds like the current documentation is confusing. Do you have a suggestion on how to make it more clear? Since the documentation is the first place developers go we want it as helpful as possible.

    I know that it's confusing that dictionaries allow symbols to used as a key while the object store does not. It's a limitation of symbols at this point and we hope to improve upon this in the future.
  • Former Member
    Former Member over 10 years ago
    The keys mentioned are the property keys, not the keys for the dictionary. But it doesn't really matter. I'm fine with using strings as keys for my dictionary and I don't know how you could make documentation more correct without making it more confusing to read. Thanks.