vss-web-extension-sdk icon indicating copy to clipboard operation
vss-web-extension-sdk copied to clipboard

ExtensionDataService's key-length should be guarded

Open keesschollaart81 opened this issue 6 years ago • 2 comments

Most of the ExtensionDataService's operations take a key as parameter. After a lot of digging I found out this key is bound to 50 characters. This does not have to be a problem but it's not documented and also does not trow an exception in the SDK or serverside. This can cause weird behavior like this:

VSS.getService(VSS.ServiceIds.ExtensionData)
    .then(function (dataService) {
    var ourValue = "Hello World";
    var key1 = "00000000000000000000000000000000000000000000000001"; // 51 characters
    var key2 = "00000000000000000000000000000000000000000000000002";
    return dataService.setValue(key1, ourValue).then(function (x) {
        dataService.getValue(key2).then(function (y) {
            alert(ourValue == y); // true
        });
    });
});

keesschollaart81 avatar Mar 15 '18 15:03 keesschollaart81

@keesschollaart81 Actually this was a bug in VSTS/TFS. The actual char limit is 100 but due to this bug in product it was limited to 50. We just fixed it this week. It should make production sometime this week or next

mohitbagra avatar Mar 22 '18 01:03 mohitbagra

This bug has been fixed in VSTS. The char limit for the key is 100 chars. @serkan-inci Should we document this?

mohitbagra avatar May 14 '18 14:05 mohitbagra