Comments (7)
Let me know if there is an outline of what this work entails and if it is a suitable first time issue for newcomer. If so I would be happy to help!
from atrium.
I believe that with the #96 and #98 update, records containing embedded images can now be deserialized correctly and the error should no longer occur.
from atrium.
Facing the same problem.
I suspect that the following issue of ciborium
crate is related.
from atrium.
I'm currently working on resolving this issue and expect to fix it by applying #96.
I believe serde_ipld_dagcbor
is more appropriate than ciborium
for deserializing data in DAG-CBOR format, including cid
, and I have submitted a pull request for one issue there
ipld/serde_ipld_dagcbor#21
I think that once these are resolved, we can deserialize all messages correctly. Please wait a bit until the new version comes out.
from atrium.
Tested using latest atrium-api
(plus #121), and patching in ipld/serde_ipld_dagcbor@ffae329 (which includes ipld/serde_ipld_dagcbor#23), using the following code to deserialize a post containing an embedded image:
let post: app::bsky::feed::post::Record = serde_ipld_dagcbor::from_reader(&data[..])?;
When no additional atrium-api
features are enabled, I get the following error:
Error: Msg("data did not match any variant of untagged enum BlobRef")
When I enable the dag-cbor
feature of atrium-api
, the post parses correctly.
And for completeness, if I enable the dag-cbor
feature of atrium-api
but don't patch serde_ipld_dagcbor
, I get this error:
Error: Msg("Only bytes can be deserialized into a CID")
from atrium.
@str4d Yes, that's right!
The CidLink
deserialization uses a slightly odd method because the schema is different for JSON format and for DAG-CBOR format: to accommodate both formats, the deserialize
method converts once to Ipld to determine the format. But this seemed to have some overhead.
Benchmark for checking it: https://github.com/sugyan/atrium/blob/main/atrium-api/benches/cid-link.rs
(Looks like we need libipld_core
in dev-dependencies...)
So I implemented CidLink
for DAG-CBOR as an additional feature, because I thought it is better to use only simple JSON objects if the user knows that the user will only use JSON format.
Sorry for the lack of documentation.
...But now we should probably use types::string::Cid
for the link string of cid_link_json
as well, and then it would be useless to worry about the overhead anymore, so maybe we can make it the default implementation.
from atrium.
This is resolved at #98
from atrium.
Related Issues (20)
- Subscribe repos example? HOT 6
- wasm32 support? HOT 3
- Progress update / coverage? HOT 2
- Remove support for surf HTTP client
- types of atrium-api
- logo image HOT 4
- Error on atrium-cli get-timeline HOT 2
- Labels and moderation functions for AtpAgent
- Upgrade to version 1.0 of the http crate?
- Introduction of Builders
- Add new string formats
- `app.bsky.feed.getPosts` fails with more than a certain number of arguments `uris`
- MST and repository parsing APIs HOT 3
- axum support HOT 4
- `atrium_xrpc_server` isn't compatible with `tokio::spawn` HOT 1
- [suggestion] Consider making XrpcClient::auth return an owned value HOT 2
- reqwest with rusttls feature flag HOT 1
- Plans for an atrium PDS? HOT 4
- Suggestion: Change code writer HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atrium.