devnull,
@devnull@crag.social avatar

Finally figured out why posts weren't queryable via Mastodon, turns out it does Content-Type checking, and I was inadvertently breaking spec by sending in application/json when I should've been sending in "application/activity+json" or 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'

Latter doesn't play nicely with express, so using the former and all's well!

Full credit to @bouncepaw who gave me key to figuring it out! 🏅

Re: https://crag.social/@devnull/111858296718131764

AltCode,
@AltCode@vivaldi.net avatar

@devnull Nice! This time I actually was able to query for the posts in my instance!

Just one problem I noticed: I was able to query the post link, but not the topic link. So https://bb.devnull.land/post/2 worked, but https://bb.devnull.land/topic/2/this-is-the-first-piece-of-federated-content-sent-by-nodebb did not.

Not sure if the latter link is meant to work for querying as well though, but just thought I'd let you know.

Other than that, no problem federating the posts to my instance!

devnull,
@devnull@crag.social avatar

@AltCode great! Love confirmatory feedback 😅 As of today my immediate plans are to establish user follows (✅) and category follows (🟡 in progress).

I'm torn between whether I should expose topics themselves as actors, as that implies that they can be followed. That in and of itself is not a problem on the NodeBB side of things, but it does mean that someone's follow list could be cluttered with a lot of "topics" instead of users. So there are some additional considerations to consider.

devnull,
@devnull@crag.social avatar

@AltCode after your post I gave it some more thought. It seems that while Lemmy or kbin (I forget which) have similar concepts of topics enveloping posts, they are still served to Mastodon as notes, the "common currency" of the , if you will.

There's no particular reason why searching for a topic shouldn't just return the first post in the topic. I'll give that a shot.

AltCode,
@AltCode@vivaldi.net avatar

@devnull “There's no particular reason why searching for a topic shouldn't just return the first post in the topic.”

Tbh, that’s actually what I was expecting would happen when I tried to query the topic URL.

devnull,
@devnull@crag.social avatar

@AltCode Done, a topic will now respond with a Page object, matching behaviour from Lemmy/kbin.

Mastodon will elect to show just the topic title and a link to the topic, but that is an implementation decision by them.

AltCode,
@AltCode@vivaldi.net avatar

@devnull Does this mean that in the future, post will federate as replies to their respective topic in the page object shown in Mastodon?

Right now, they seem to be unlinked, but I'm assuming that's either because the topic itself wasn't being federated before, which caused a federation problem that future posts and topics will not face, or because the link between these posts and the topic is currently not being sent so mastodon is just unaware that it's supposed to link them up.

Screenshot of a NodeBB topic from @julian federated to Vivaldi Social without no replies despite having them in the remote server.

devnull,
@devnull@crag.social avatar

@AltCode That's a good question. At this time I can only try to provide as much linkage and context as I can, and it's up to individual implementors to handle.

In 's case, each post will have an inReplyTo that points to its direct reply. OP (the root level post) does not have an inReplyTo.

All posts send audience which points to the TOPIC. Each topic (the Page object) sends audience which points to the category.

1b12 leaves no room for topic references in replies 🫤

devnull,
@devnull@crag.social avatar

@AltCode It's tough because there's no direct object type for a collection of Notes.

"as:Article" is like a longer note, and "as:Page" is a generic web page.

"OrderedCollection" would fit but is a stricter sub-type of as:Object and I'm honestly not certain what other implementors would do if I served that up.

Its omission in FEP 1b12 might be unintentional, or it may be purposeful. Starting a separate thread about this...

trwnh,
@trwnh@mastodon.social avatar

@devnull interested in hearing more about the "doesn't play nicely with express" bit! in practical terms you find both types in usage, but ld+json is a MUST in activitypub for GET/POST requests at least.

devnull,
@devnull@crag.social avatar

@trwnh I didn't particularly want to get into internals earlier today, so I didn't dig into it, but months ago I wasn't able to express.accepts() with the expected header. It either hung or kept returning false, I forget now.

Today I attempted to res.set('Content-Type', 'application/ld+json; profile="<https://www.w3.org/ns/activitystreams>"'); but the app hung.

Either way it works fine if "profile" clause is removed, but then that's not the right header 😃

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse
  • DreamBathrooms
  • ngwrru68w68
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • tacticalgear
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • ethstaker
  • JUstTest
  • GTA5RPClips
  • modclub
  • tester
  • Leos
  • osvaldo12
  • cisconetworking
  • everett
  • cubers
  • normalnudes
  • anitta
  • megavids
  • provamag3
  • lostlight
  • All magazines