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.
@freamon As others have said, ChatMessage is non-standard. The Create/Note is not particularly great for private messages, but whatever. Anyway, cc is not a required field of Note nor Create, so any software that would complain has a bug.
@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.
@freamon @rikudou
https://github.com/NodeBB/NodeBB/issues/13202
In a bit of code that is too clever for my own good, I collapse
to
andcc
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:
@julian Wouldn’t
??
be better?@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: