maidsafe-archive / safe_examples

examples showcasing various features of the SAFE Network
BSD 3-Clause "New" or "Revised" License
82 stars 50 forks source link

"value" argument must not be a number error in Electron and Web App Examples #409

Closed manavbp closed 5 years ago

manavbp commented 5 years ago

Steps to reproduce: Follow the tutorial until the insert new mutations portion in both Electron and Web App tutorials. Following error shows up in the console:

firstbug

bochaco commented 5 years ago

Thanks a lot @manavbp for reporting this, I closed the PR you also sent as we've been investigating this further with @hunterlester , and the issue is not with the tutorials/boilerplates but with safe-node-app v0.10.x (in fact the tutorials work fine with safe-node-app v0.9.1 or earlier).

The safe_app lib supports a key to be a number or a string, so the safe-node-app shall also support both data types for an entry's key.

bochaco commented 5 years ago

I was looking at this more closely and checking in safe_app to understand if it would make sense to support an entry's key to be either numeric or string, but it seems that in SCL we are always passing it as an array of bytes and I guess they are treated in SCL as a string, so even if we were kinda supporting both types in our safe-app-nodejs API we were internally doing the convertion to/from string always. So, it seems that we can probably just keep it as is and fix the tutorials boilerplates as you @manavbp were doing in your PR https://github.com/maidsafe/safe_examples/pull/410

I in parallel sent a PR to safe-app-nodejs with additional tests for inserting and fetching entryes with strings and numbers. https://github.com/maidsafe/safe_app_nodejs/pull/345