Skip to content
  • Categories
  • Recent
  • Popular
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB-ActivityPub Bridge Test Instance

  1. Home
  2. Categories
  3. General Discussion
  4. AP Test (community.nodebb.org)
  5. Sending a private message without cc causes a 500 error

Sending a private message without cc causes a 500 error

Scheduled Pinned Locked Moved AP Test (community.nodebb.org)
19 Posts 4 Posters 90 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R This user is from outside of this forum
    R This user is from outside of this forum
    rikudou@community.nodebb.org
    wrote on last edited by
    #1

    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.

    julian@community.nodebb.orgJ 1 Reply Last reply
    0
    • R rikudou@community.nodebb.org

      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.

      julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.orgJ This user is from outside of this forum
      julian@community.nodebb.org
      wrote on last edited by
      #2

      @rikudou thanks, can you file an issue on the GitHub repo?

      Link Preview Image
      Build software better, together

      GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

      favicon

      GitHub (github.com)

      1 Reply Last reply
      0
      • freamon@community.nodebb.orgF This user is from outside of this forum
        freamon@community.nodebb.orgF This user is from outside of this forum
        freamon@community.nodebb.org
        wrote on last edited by
        #3

        @rikudou As far as I understand things, a 'private message' in ActivityPub is Create / ChatMessage, not Create / Note. I think NodeBB wouldn't be the only software to complain if 'cc' is missing from either part of Create / Note (although it's not expected in either part of Create / ChatMessage).

        1 Reply Last reply
        0
        • julian@community.nodebb.orgJ This user is from outside of this forum
          julian@community.nodebb.orgJ This user is from outside of this forum
          julian@community.nodebb.org
          wrote on last edited by
          #4

          @freamon Create(ChatMessage) is not part of ActivityPub. From my light research online it is something added by a Pleroma extension and possibly supported by Lemmy.

          NodeBB will automatically slot received non-public notes as chat messages.

          1 Reply Last reply
          0
          • freamon@community.nodebb.orgF This user is from outside of this forum
            freamon@community.nodebb.orgF This user is from outside of this forum
            freamon@community.nodebb.org
            wrote on last edited by
            #5

            @julian Oh, right. Thanks. But yeah, it's what Lemmy (and PieFed) uses, so I just assumed it was part of AP, and never looked into it any further.

            I was thinking while typing this "I bet that means that chat messages from NodeBB to PieFed will fail", which I just tested, and sure enough they do (I'll make an Issue for it on PieFed's repo).

            1 Reply Last reply
            0
            • julian@community.nodebb.orgJ This user is from outside of this forum
              julian@community.nodebb.orgJ This user is from outside of this forum
              julian@community.nodebb.org
              wrote on last edited by
              #6

              Ah, that's unfortunate. When NodeBB sends a chat message out, it is just a regular Note with the recipients directly addressed, with no as:Public pseudo-user.

              So as long as PieFed handles mentioned-only notes the activity should be processed...

              1 Reply Last reply
              0
              • freamon@community.nodebb.orgF This user is from outside of this forum
                freamon@community.nodebb.orgF This user is from outside of this forum
                freamon@community.nodebb.org
                wrote on last edited by
                #7

                @julian It currently doesn't. If someone is Mentioned, the assumption is that it was part of post / comment in a community, and it fails because it can't find the community. I know that, for Lemmy, if you Mention someone in a comment, and they don't have a copy of the community (or they do and there's no local subscribers to it), then it will reject it. I don't know what it does if there's no community at all (I'll figure out a way to test it, on a server I can control).

                1 Reply Last reply
                0
                • freamon@community.nodebb.orgF This user is from outside of this forum
                  freamon@community.nodebb.orgF This user is from outside of this forum
                  freamon@community.nodebb.org
                  wrote on last edited by
                  #8

                  @freamon Update: no, Lemmy doesn't understand them either. It rejects Create / Note without a community with the usual "did not match any variant of untagged enum AnnouncableActivities"

                  1 Reply Last reply
                  0
                  • nutomic@lemmy.mlN This user is from outside of this forum
                    nutomic@lemmy.mlN This user is from outside of this forum
                    nutomic@lemmy.ml
                    wrote on last edited by
                    #9

                    FYI the next Lemmy version will use Create/Note for private messages. You can test it on voyager.lemmy.ml

                    Link Preview Image
                    Add note wrapper (fixes #2657) by Nutomic · Pull Request #5221 · LemmyNet/lemmy

                    Private messages and public comments are quite awkward in Activitypub, because the json format looks identical. They only way to differentiate them is to check for the presence or absence of https:...

                    favicon

                    GitHub (github.com)

                    julian@community.nodebb.orgJ 1 Reply Last reply
                    0
                    • nutomic@lemmy.mlN nutomic@lemmy.ml

                      FYI the next Lemmy version will use Create/Note for private messages. You can test it on voyager.lemmy.ml

                      Link Preview Image
                      Add note wrapper (fixes #2657) by Nutomic · Pull Request #5221 · LemmyNet/lemmy

                      Private messages and public comments are quite awkward in Activitypub, because the json format looks identical. They only way to differentiate them is to check for the presence or absence of https:...

                      favicon

                      GitHub (github.com)

                      julian@community.nodebb.orgJ This user is from outside of this forum
                      julian@community.nodebb.orgJ This user is from outside of this forum
                      julian@community.nodebb.org
                      wrote on last edited by
                      #10

                      @nutomic@lemmy.ml thanks for the update! That's awesome to hear

                      1 Reply Last reply
                      0
                      • freamon@community.nodebb.orgF This user is from outside of this forum
                        freamon@community.nodebb.orgF This user is from outside of this forum
                        freamon@community.nodebb.org
                        wrote on last edited by
                        #11

                        @julian I've added support to PieFed to successfully receive Create / Note as a PM from NodeBB.

                        From Nutomic's PR, it looks like you'll continue you get Create / ChatMessage from them, as also you will from PieFed. This currently fails, as I guess that it converts them into a Create / Note, but then complains of there being no 'cc'.

                        It doesn't make sense for PMs to be 'carbon copied' to anyone, so I'll raise an Issue at your repo.

                        1 Reply Last reply
                        0
                        • julian@community.nodebb.orgJ This user is from outside of this forum
                          julian@community.nodebb.orgJ This user is from outside of this forum
                          julian@community.nodebb.org
                          wrote on last edited by
                          #12

                          @freamon thanks! Happy to look into handling Create(ChatMessage)... I think the error aside, NodeBB would drop it anyway since ChatMessage isn't an expected post type.

                          1 Reply Last reply
                          0
                          • freamon@community.nodebb.orgF This user is from outside of this forum
                            freamon@community.nodebb.orgF This user is from outside of this forum
                            freamon@community.nodebb.org
                            wrote on last edited by
                            #13

                            @julian Oh, I've just realised I read Nutomic's PR the wrong way around. After 2.0, you'll start getting Notes from them. If 'ChatMessage' processing isn't worth handling by NodeBB, I can change PieFed to send you Notes instead.

                            1 Reply Last reply
                            0
                            • R This user is from outside of this forum
                              R This user is from outside of this forum
                              rikudou@community.nodebb.org
                              wrote on last edited by
                              #14

                              @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.

                              1 Reply Last reply
                              0
                              • freamon@community.nodebb.orgF This user is from outside of this forum
                                freamon@community.nodebb.orgF This user is from outside of this forum
                                freamon@community.nodebb.org
                                wrote on last edited by
                                #15

                                @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.

                                1 Reply Last reply
                                0
                                • julian@community.nodebb.orgJ This user is from outside of this forum
                                  julian@community.nodebb.orgJ This user is from outside of this forum
                                  julian@community.nodebb.org
                                  wrote on last edited by
                                  #16

                                  @freamon @rikudou

                                  Link Preview Image
                                  Missing cc on incoming non-public payload causes note assertion failure · Issue #13202 · NodeBB/NodeBB

                                  https://community.nodebb.org/topic/18642/sending-a-private-message-without-cc-causes-a-500-error/14

                                  favicon

                                  GitHub (github.com)

                                  1 Reply Last reply
                                  0
                                  • julian@community.nodebb.orgJ This user is from outside of this forum
                                    julian@community.nodebb.orgJ This user is from outside of this forum
                                    julian@community.nodebb.org
                                    wrote on last edited by
                                    #17

                                    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 || [])]);

                                    😎

                                    1 Reply Last reply
                                    0
                                    • R This user is from outside of this forum
                                      R This user is from outside of this forum
                                      rikudou@community.nodebb.org
                                      wrote on last edited by
                                      #18

                                      @julian Wouldn't ?? be better?

                                      1 Reply Last reply
                                      0
                                      • julian@community.nodebb.orgJ This user is from outside of this forum
                                        julian@community.nodebb.orgJ This user is from outside of this forum
                                        julian@community.nodebb.org
                                        wrote on last edited by
                                        #19

                                        @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 😄

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Login or register to search.
                                        Powered by NodeBB Contributors
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Popular