window.safeMutableDataEntries.forEach

When using window.safeMutableDataEntries.forEach ,

until browser 0.7 , I used to be able to read the returned keys as strings.

Now, with the 0.8 browser I get an object in the form of :
Object {0: 95, 1: 109, 2: 101, 3: 116, 4: 97, 5: 100, 6: 97, 7: 116, 8: 97, _refs: Array(1)}

I see that it translates into : _metadata : _

Is window.safeMutableDataEntries.forEach supposed to return a key for the mutable metadata ? I don’t think it was the case before.

How do you access the key name now ? the doc ( 0.4.3 ) says : k.toString() , but this just returns “[object Object]”

I make an issue with this here too : https://github.com/maidsafe/beaker-plugin-safe-app/issues/117 - not sure if it is the correct place

2 Likes

I have the same symptoms, its wither a bug in 0.8.0 or the documentation needs updating. Have noted on the issue you created.

1 Like

Until we know more about this, I went around with this :

  var key ="";
  for (var keys in k) {
            key += String.fromCharCode(k[keys] );
  }

and testing the result with :

key.includes( some_string )

1 Like

@nice, @happybeing, this was reported on github and its PR is already merged and waiting for next release of the browser where it will be fixed: https://github.com/maidsafe/beaker-plugin-safe-app/issues/114

5 Likes

Thank you !! Sorry I missed this one. Glad to see you are on it :slight_smile:

3 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.