Adding unique ap_ids. Fixes #1100 #90
Loading…
Reference in New Issue
No description provided.
Delete Branch "unique_ap_ids"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -62,3 +62,3 @@
fn create(conn: &PgConnection, comment_form: &CommentForm) -> Result<Self, Error> {
println!("creating {}", &comment_form.ap_id);
// println!("creating {}", &comment_form.ap_id.as_ref().unwrap());
I had to comment this because it failed for some of the tests, where this
ap_id
is None.Just put it into an
if Some(ap_id) = form.ap_id
?@ -46,3 +46,3 @@
impl CommentForm {
pub fn get_ap_id(&self) -> Result<Url, ParseError> {
Url::parse(&self.ap_id)
Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string()))
Seemed easier than doing
-> Option<Result<Url...
@ -186,1 +186,3 @@
.on_conflict_do_nothing()
.on_conflict(ap_id)
.do_update()
.set(post_form)
I did it like this on purpose, because otherwise someone could abuse a Create activity to update a post. And under normal circumstances, the old and new post should be identical.
Hrm... I spose this is the case for comments too. I'll change both, either way they should get real updates through the push, not the fetcher anyway, and the push looks like it correctly uses
::update
.Okay I finally got these builds working on travis: https://travis-ci.org/github/LemmyNet/lemmy/builds/722512931
Great! Tests are also passing fine for me (only tried one run). So this should be good to merge?