Closed edisonlsm closed 1 year ago
Thanks for your contribution! :)
Hi @edisonlsm !
Thanks for this issue :) When I tried it a few weeks ago, no error occurred, but maybe I didn't have enough test cases.
Also, as an aside, the embed
field has the most challenging structure: it is a Union with 4 types. But, from reading your Issue, it doesn't seem to be that difficult a problem. I will check and fix it soon, thank you anyway! :)
@edisonlsm
I understand why. I had missed that media
in the hierarchy below embed
is also Union.
I would fix it by making the media
field type Union object :)
"embed": {
"$type": "app.bsky.embed.recordWithMedia",
"media": {
"$type": "app.bsky.embed.external",
"external": {
"uri": "https://bluesky-heatmap.fly.dev/",
"thumb": {
"$type": "blob",
"ref": {
"$link": "bafkreig4g4l6fwfl6r5z7yydzzfo2l26k5pajgdq2ue2tdu3xszbd3y6p4"
},
"mimeType": "image/jpeg",
"size": 267294
},
"title": "Bluesky Posts Heatmap Generator",
"description": "Generates GitHub-style heatmaps from your Bluesky posts."
}
},
"record": {
"$type": "app.bsky.embed.record",
"record": {
"cid": "bafyreic26yhtn46jxaggts75mbzmxth3tab6k5wj6krbvrumj5t63jqnjq",
"uri": "at://did:plc:by3jhwdqgbtrcc7q4tkkv3cf/app.bsky.feed.post/3jtoq4zmhvz2z"
}
}
},
@edisonlsm ,
I fixed this bug and it works now. I will release with some atproto
features, I will prepare until tomorrow :)
Oh, great to hear that @myConsciousness !!!
I hadn't dig deeper on the list embed structure until finding this bug, but now I see how complex it is 😰 Specially since we have 4 different embeds, each one with their own structure...
Good to have Bluesky growing the number of users and with that having more test cases 😅
Hi @edisonlsm ,
If Dart supported Union as a language spec, this difficult process would not be necessary. The Dart team should have supported Union before I had to create this process lol
Anyway it's okay now, please just wait for release! :^)
@edisonlsm ,
I released fix build! It's bluesky v0.3.8
, please try it!
Worked like a charm 😄
1. Current bug behavior
When trying to get a post with an embedded URL, the constructor is throwing the following error:
Unfortunately, I could not dig deeper at the issue since I am not familiar with Freezed or the JSON Serialization method you are using, otherwise I would try to open a PR :(
But what I could get is that for some reason it's trying to create a
EmbedViewImages
and looking for an images array at the JSON even though the embed type isapp.bsky.embed.external
.2. Expected behavior
I would expect the object to be parsed correctly.
3. Steps to reproduce
I first detected this bug when trying to load the timeline, but (fortunately) the issue is also reproducible when loading the thread for the specific post!
The following request should throw this same exception on parse:
4. Flutter doctor output
5. More environment information
atproto: 0.2.5 bluesky: 0.3.7