I’m refactoring a conventional app that I created in order to learn the SAFE API.
Repository: https://github.com/hunterlester/safe_rabbit_hole
Creating this thread to post questions that I have along the way. Thank you for your help.
First problem
I’m attempting to append appendable data to another appendable data, ultimately calling PUT /appendable-data/:handleId/:dataIdHandle
(https://github.com/hunterlester/safe_rabbit_hole/blob/master/app/components/compose_mail.js#L43)
Error response:
description: "FfiError::InvalidDataIdHandle",
errorCode: -1514
I’d like to learn about what I’m doing wrong while also learning about core files:
The appendable_data_append
function at https://github.com/maidsafe/safe_client_libs/blob/0.22.1/src/ffi/low_level_api/appendable_data.rs#L668 appears to be throwing an error at https://github.com/maidsafe/safe_client_libs/blob/0.22.1/src/ffi/low_level_api/appendable_data.rs#L677
The get_data_id
function (https://github.com/maidsafe/safe_client_libs/blob/0.22.1/src/ffi/low_level_api/object_cache.rs#L122) according to the documentation (http://contain-rs.github.io/lru-cache/lru_cache/struct.LruCache.html#method.get_mut), “Returns a mutable reference to the value corresponding to the given key in the cache, if any”
get_data_id
, if not an FfiError, should return a mutable reference to DataIdentifier wrapped in a Result. DataIdentifier is an enum that should be one of four data types (https://github.com/maidsafe/routing/blob/master/src/data/mod.rs#L111)
I’m expecting that the data id handle that I’m passing in belongs to a public appendable data.
I need help from here.
As I intend to post further questions in this thread, please let me know if I can improve the format for ease of reading