Convert Post and Comment to new activitystreams library version #69

Manually merged
nutomic merged 2 commits from more-upgrade-apub into main 2020-07-15 16:50:51 +00:00
Owner

Need to make sure that I copied all the parameters correctly.

The test Create comment on alpha and search it is failing. Did you change the comment routing recently? The website shows http://localhost:8550/post/2/comment/1 as URL, but the routing is setup for http://localhost:8550/comment/1.

Need to make sure that I copied all the parameters correctly. The test `Create comment on alpha and search it` is failing. Did you change the comment routing recently? The website shows `http://localhost:8550/post/2/comment/1` as URL, but the routing is setup for `http://localhost:8550/comment/1`.
Owner

The 2nd url is the correct activitypub one. The first is just a way for the front end to scroll to that location.

The 2nd url is the correct activitypub one. The first is just a way for the front end to scroll to that location.
dessalines reviewed 2020-07-15 14:56:48 +00:00
@ -4,3 +3,1 @@
extensions::signatures::sign,
insert_activity,
is_apub_id_valid,
community::do_announce, extensions::signatures::sign, insert_activity, is_apub_id_valid,
Owner

Make sure you run cargo +nightly fmt

Make sure you run `cargo +nightly fmt`
Author
Owner

Thanks, I forgot.

Thanks, I forgot.
Owner

Running the test gave me this error on comment creation:

lemmy-beta_1      | thread 'actix-rt:worker:3' panicked at 'called `Option::unwrap()` on a `None` value', src/apub/fetcher.rs:173:78
lemmy-beta_1      | stack backtrace:

Which is this line:

    SearchAcceptedObjects::Comment(c) => {
      let post_url = c.in_reply_to.as_ref().unwrap().as_single_xsd_any_uri().unwrap();

Which tells me the comment in_reply_tos aren't being built correctly as before. Comments should always include the post_url as the first in_reply_to, and the parent_comment (if it exists) as the next one.

Running the test gave me this error on comment creation: ``` lemmy-beta_1 | thread 'actix-rt:worker:3' panicked at 'called `Option::unwrap()` on a `None` value', src/apub/fetcher.rs:173:78 lemmy-beta_1 | stack backtrace: ``` Which is this line: ``` SearchAcceptedObjects::Comment(c) => { let post_url = c.in_reply_to.as_ref().unwrap().as_single_xsd_any_uri().unwrap(); ``` Which tells me the comment in_reply_tos aren't being built correctly as before. Comments should always include the post_url as the first in_reply_to, and the parent_comment (if it exists) as the next one.
dessalines reviewed 2020-07-15 15:10:04 +00:00
@ -177,3 +173,1 @@
.next()
.unwrap()
.to_string();
let post_url = c.in_reply_to.as_ref().unwrap().as_single_xsd_any_uri().unwrap();
Owner

Its probably this. This isn't a single, but a many_in_reply_tos.

Its probably this. This isn't a single, but a many_in_reply_tos.
Author
Owner

Seems like that was it, tests are passing now.

Seems like that was it, tests are passing now.
Author
Owner

So I might have been testing the wrong thing then. Anyway it would be nice if the HTTP url for a comment and the apub ID were the same, so you can easily search for it (same way as for posts or communities).

So I might have been testing the wrong thing then. Anyway it would be nice if the HTTP url for a comment and the apub ID were the same, so you can easily search for it (same way as for posts or communities).
Owner

I'm testing now.

We might add a https://instance/comment/X at some point, especially once tree paging starts to get worked on. But right now, just showing a single comment on the front end isn't too useful.

I'm testing now. We might add a https://instance/comment/X at some point, especially once tree paging starts to get worked on. But right now, just showing a single comment on the front end isn't too useful.
nutomic manually merged commit 2d4c41d2be into main 2020-07-15 16:50:51 +00:00
Author
Owner

I'm not talking about changing anything in the way things are displayed. Just that you can take a comment link, paste it directly into the search and have it fetch that remote object.

I'm not talking about changing anything in the way things are displayed. Just that you can take a comment link, paste it directly into the search and have it fetch that remote object.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LemmyNet/lemmy#69
No description provided.