You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you check to see if this issue already exists?
Is this only a single bug? Do not put multiple bugs in one issue.
Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Summary
In purge post an image is only purged from pictrs when the image url is included as the post url. In cases where the image is not the url, or where the body contains multiple images that were uploaded (commonly known as an "image set"), these are not removed.
However, because the references to these images is lost when the post body is deleted, it becomes impossible to retrieve them as we no longer know the alias that was used.
Steps to Reproduce
Upload an image while making a post
Do not include the image as the post url (or upload more than 1 image)
Once posted, copy the image url that we are testing (any not included as the post url)
// Purge image
if let Some(url) = post.url {
purge_image_from_pictrs(context.client(), context.settings(), &url)
.await
.ok();
}
// Purge thumbnail
if let Some(thumbnail_url) = post.thumbnail_url {
purge_image_from_pictrs(context.client(), context.settings(), &thumbnail_url)
.await
.ok();
}
The image purge needs to iterate over the url in the title AND the post body, searching for all references to pictrs on the domain.
The biggest problem is that the post body is deleted, so we don't even know where those images are and have no way to get them out of pictrs without opening each one.
Version
18.0
Lemmy Instance URL
No response
The text was updated successfully, but these errors were encountered:
Honestly I see this as an issue in all of the purge logic. For comments, there is no image check. In community and person purging, we're only purging the images that are in post urls, but not post body or comment bodies. But once the bodies containing the links are gone, the files are just lost in the sled db
I also don't seem to have a good way to inspect the sled db, if I could extract all the aliases I could query the db to find "orphaned" images like this mentions #1331
I see the convo here: #1809 (comment) - at least you guys saw it coming!
Requirements
Summary
In purge post an image is only purged from pictrs when the image url is included as the post url. In cases where the image is not the url, or where the body contains multiple images that were uploaded (commonly known as an "image set"), these are not removed.
However, because the references to these images is lost when the post body is deleted, it becomes impossible to retrieve them as we no longer know the alias that was used.
Steps to Reproduce
Technical Details
In my opinion, the offending code begins here: https://github.com/LemmyNet/lemmy/blob/main/crates/api/src/site/purge/post.rs#L36
The image purge needs to iterate over the url in the title AND the post body, searching for all references to pictrs on the domain.
The biggest problem is that the post body is deleted, so we don't even know where those images are and have no way to get them out of pictrs without opening each one.
Version
18.0
Lemmy Instance URL
No response
The text was updated successfully, but these errors were encountered: