this post was submitted on 19 Feb 2025
0 points (NaN% liked)

ActivityPub

0 readers
1 users here now

Focused discussion related to ActivityPub integration in NodeBB


This is a forum category containing topical discussion. You can start new discussions by mentioning this category.

founded 2 months ago
 

The logs from this are already cleared on my server, but when I sent a private message (standard Create/Note with a single recipient who also has a Mention in the tag property) from my custom software to my account here, I received a 500 error saying something like "cc is not iterable" (though I don't know the exact phrasing). When I included cc as an empty array, it started working. Not sure whether it was missing on Create or Note, maybe it was both.

you are viewing a single comment's thread
view the rest of the comments
[–] freamon@community.nodebb.org 1 points 3 weeks ago (1 children)

@rikudou Yeah, sorry, I didn't mean to derail this thread. The GitHub issue was intended to only really be about the 'cc' problem, because it looks like PieFed will have to start sending Create/Note to non-Lemmy platforms anyway, but it'd easier if 'cc' doesn't have to be artificially included to keep NodeBB happy.

[–] julian@community.nodebb.org 1 points 3 weeks ago (1 children)
[–] julian@community.nodebb.org 1 points 3 weeks ago (1 children)

In a bit of code that is too clever for my own good, I collapse to and cc into a single deduplicated array with:

const recipients = new Set([...object.to, ...object.cc]);

Which of course assumes that both properties are iterable. That has now been changed to an even clever-er (and less readable):

const recipients = new Set([...(object.to || []), ...(object.cc || [])]);

:sunglasses:

[–] rikudou@community.nodebb.org 1 points 3 weeks ago (1 children)
[–] julian@community.nodebb.org 1 points 3 weeks ago

@rikudou maybe? Nullish coalescing sounds really cool, but I've avoided it for years because of browser compatibility.

Node has had support forever (since v14, I've discovered), but I just don't know how to use it is all :smile: