Skip to content
  • Hjem
  • Seneste
  • Etiketter
  • Populære
  • Verden
  • Bruger
  • Grupper
Temaer
  • 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
Kollaps
FARVEL BIG TECH
  1. Forside
  2. Ikke-kategoriseret
  3. Reconciling ActivityPub Deletes with NodeBB deletion

Reconciling ActivityPub Deletes with NodeBB deletion

Planlagt Fastgjort Låst Flyttet Ikke-kategoriseret
activitypub
20 Indlæg 10 Posters 0 Visninger
  • Ældste til nyeste
  • Nyeste til ældste
  • Most Votes
Svar
  • Svar som emne
Login for at svare
Denne tråd er blevet slettet. Kun brugere med emne behandlings privilegier kan se den.
  • B blaue_fledermaus@mstdn.io
    8. maj 2024, 15.05

    @julian
    I don't know how it works at ActivityPub level, but would it make sense to represent a soft delete as an update to the visibility of the object? Like as a Mastodon user, if I changed a post to private?

    J This user is from outside of this forum
    J This user is from outside of this forum
    julian@community.nodebb.org
    wrote on 8. maj 2024, 15.08 sidst redigeret af
    #3

    @blaue_Fledermaus@mstdn.io — interesting idea, but my gut feeling is no, because post visibility (which at present, NodeBB doesn’t even support at all) and deletion are two separate properties in ActivityPub.

    One is defined in the object itself (to, cc, etc.), whereas if a post is deleted, it simply ceases to exist or becomes a Tombstone.

    1 Reply Last reply
    0
    • J julian@community.nodebb.org
      8. maj 2024, 14.09

      For a lot of things in ActivityPub, there are almost direct parallels in NodeBB. An as:Note object pairs well with a NodeBB post, an as:Person is a NodeBB user, etc.

      One thing that didn’t map 1:1 was the Delete activity, which at surface level, seems rather straightforward — just delete the object! However, once you dig in, there are some additional considerations:

      • in NodeBB, we have two separate states for content removal.
        • A delete, where the post is still present (but its content unavailable to non-privileged users), and a
        • A purge, where the post is scrubbed from the database entirely, and all references to it, removed
      • in ActivityPub, there is a single activity, as:Delete
      • Implementors may opt to replace the object representation with an as:Tombstone (how quaint!), but they may also just opt to use a 404

      So there are some nuances that are left intentionally vague.

      Kaniini on SocialHub makes the argument that a Delete should be treated like a cache invalidation, which has its own merits.


      This is how NodeBB will interpret the protocol specification, and how we will align it with our own dual-state post deletion mechanic (delete & purge):

      1. When a local post is deleted, we will federate out an Update(Tombstone) referencing the id
      2. Afterwards, if the content is retrieved, an as:Tombstone will be served.
        • Deleted posts in NodeBB still maintain their place in the topic, so when the context is retrieved, the note will still be present in the collection.
      3. If we receive an Update(Tombstone), we will delete the local representation of the post
      4. When a local post is purged, we will federate out a Delete(Note)
      5. Afterwards, if the content is retrieved, we will serve a 404
        • The note will no longer exist in the context collection
      6. If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:
        • If we see an as:Tombstone, we will delete the post (soft delete)
        • If we encounter a 404 or 410, we will purge the post (hard delete)

      I’m writing this out less as a guideline for myself, but to solicit opinions and to give others a chance to point out if I’ve interpreted the spec incorrectly.

      E This user is from outside of this forum
      E This user is from outside of this forum
      eeeee@community.nodebb.org
      wrote on 8. maj 2024, 16.54 sidst redigeret af
      #4

      Just my thought, but the whole Delete then Purge has always irritated me.
      Delete should just be Delete.
      If a Mod wants to temporarily hide something they could move post, or delete and keep a copy.
      The only thing Delete then Purge does is add extra step to removing something!

      J A 2 Replies Last reply 8. maj 2024, 17.12
      0
      • E eeeee@community.nodebb.org
        8. maj 2024, 16.54

        Just my thought, but the whole Delete then Purge has always irritated me.
        Delete should just be Delete.
        If a Mod wants to temporarily hide something they could move post, or delete and keep a copy.
        The only thing Delete then Purge does is add extra step to removing something!

        J This user is from outside of this forum
        J This user is from outside of this forum
        julian@community.nodebb.org
        wrote on 8. maj 2024, 17.12 sidst redigeret af
        #5

        @eeeee said in Reconciling ActivityPub Deletes with NodeBB deletion:
        > The only thing Delete then Purge does is add extra step to removing something!

        Technically they needn’t be two steps. You could just go straight to purge.

        We toyed with the idea of removing deletes altogether… not sure where we landed haha @baris?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          Gæst
          wrote on 8. maj 2024, 18.42 sidst redigeret af
          #6

          @julian I don't know ActivityPub well enough to have a detailed set of comments but this seems sensible. In particular, using Tombstone would seem to enable good handling of cases like a deleted post with replies to it.

          1 Reply Last reply
          0
          • J julian@community.nodebb.org
            8. maj 2024, 14.09

            For a lot of things in ActivityPub, there are almost direct parallels in NodeBB. An as:Note object pairs well with a NodeBB post, an as:Person is a NodeBB user, etc.

            One thing that didn’t map 1:1 was the Delete activity, which at surface level, seems rather straightforward — just delete the object! However, once you dig in, there are some additional considerations:

            • in NodeBB, we have two separate states for content removal.
              • A delete, where the post is still present (but its content unavailable to non-privileged users), and a
              • A purge, where the post is scrubbed from the database entirely, and all references to it, removed
            • in ActivityPub, there is a single activity, as:Delete
            • Implementors may opt to replace the object representation with an as:Tombstone (how quaint!), but they may also just opt to use a 404

            So there are some nuances that are left intentionally vague.

            Kaniini on SocialHub makes the argument that a Delete should be treated like a cache invalidation, which has its own merits.


            This is how NodeBB will interpret the protocol specification, and how we will align it with our own dual-state post deletion mechanic (delete & purge):

            1. When a local post is deleted, we will federate out an Update(Tombstone) referencing the id
            2. Afterwards, if the content is retrieved, an as:Tombstone will be served.
              • Deleted posts in NodeBB still maintain their place in the topic, so when the context is retrieved, the note will still be present in the collection.
            3. If we receive an Update(Tombstone), we will delete the local representation of the post
            4. When a local post is purged, we will federate out a Delete(Note)
            5. Afterwards, if the content is retrieved, we will serve a 404
              • The note will no longer exist in the context collection
            6. If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:
              • If we see an as:Tombstone, we will delete the post (soft delete)
              • If we encounter a 404 or 410, we will purge the post (hard delete)

            I’m writing this out less as a guideline for myself, but to solicit opinions and to give others a chance to point out if I’ve interpreted the spec incorrectly.

            ? Offline
            ? Offline
            Gæst
            wrote on 8. maj 2024, 20.00 sidst redigeret af
            #7

            @julian i still say delete only makes sense as a cache invalidation when it comes to remote content. that hasn’t changed 🙂

            J 1 Reply Last reply 8. maj 2024, 20.45
            0
            • ? Gæst
              8. maj 2024, 20.00

              @julian i still say delete only makes sense as a cache invalidation when it comes to remote content. that hasn’t changed 🙂

              J This user is from outside of this forum
              J This user is from outside of this forum
              julian@community.nodebb.org
              wrote on 8. maj 2024, 20.45 sidst redigeret af
              #8

              @ariadne@social.treehouse.systems right. I think functionally I’ll never encounter a Delete, check the origin, and find that the note hasn’t actually been deleted, but stranger things have happened!

              1 Reply Last reply
              0
              • J julian@community.nodebb.org
                8. maj 2024, 14.09

                For a lot of things in ActivityPub, there are almost direct parallels in NodeBB. An as:Note object pairs well with a NodeBB post, an as:Person is a NodeBB user, etc.

                One thing that didn’t map 1:1 was the Delete activity, which at surface level, seems rather straightforward — just delete the object! However, once you dig in, there are some additional considerations:

                • in NodeBB, we have two separate states for content removal.
                  • A delete, where the post is still present (but its content unavailable to non-privileged users), and a
                  • A purge, where the post is scrubbed from the database entirely, and all references to it, removed
                • in ActivityPub, there is a single activity, as:Delete
                • Implementors may opt to replace the object representation with an as:Tombstone (how quaint!), but they may also just opt to use a 404

                So there are some nuances that are left intentionally vague.

                Kaniini on SocialHub makes the argument that a Delete should be treated like a cache invalidation, which has its own merits.


                This is how NodeBB will interpret the protocol specification, and how we will align it with our own dual-state post deletion mechanic (delete & purge):

                1. When a local post is deleted, we will federate out an Update(Tombstone) referencing the id
                2. Afterwards, if the content is retrieved, an as:Tombstone will be served.
                  • Deleted posts in NodeBB still maintain their place in the topic, so when the context is retrieved, the note will still be present in the collection.
                3. If we receive an Update(Tombstone), we will delete the local representation of the post
                4. When a local post is purged, we will federate out a Delete(Note)
                5. Afterwards, if the content is retrieved, we will serve a 404
                  • The note will no longer exist in the context collection
                6. If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:
                  • If we see an as:Tombstone, we will delete the post (soft delete)
                  • If we encounter a 404 or 410, we will purge the post (hard delete)

                I’m writing this out less as a guideline for myself, but to solicit opinions and to give others a chance to point out if I’ve interpreted the spec incorrectly.

                A This user is from outside of this forum
                A This user is from outside of this forum
                angus@socialhub.activitypub.rocks
                wrote for 30 dage siden sidst redigeret af
                #9

                @julian I'm focusing on Deletion (both Notes and Actors) in Discourse at the moment and I'm thinking of essentially adopting the approach you've outlined here. Have there been any updates to your approach since you wrote this?

                J 1 Reply Last reply for 27 dage siden
                0
                • E eeeee@community.nodebb.org
                  8. maj 2024, 16.54

                  Just my thought, but the whole Delete then Purge has always irritated me.
                  Delete should just be Delete.
                  If a Mod wants to temporarily hide something they could move post, or delete and keep a copy.
                  The only thing Delete then Purge does is add extra step to removing something!

                  A This user is from outside of this forum
                  A This user is from outside of this forum
                  angus@socialhub.activitypub.rocks
                  wrote for 30 dage siden sidst redigeret af
                  #10
                  eeeee:

                  The only thing Delete then Purge does is add extra step to removing something!

                  Discourse also uses a "soft delete" (we call it "Trash(ed)"). The main point of it is that it allows restoration if the delete was in error.

                  julian:

                  my gut feeling is no, because post visibility (which at present, NodeBB doesn't even support at all) and deletion are two separate properties in ActivityPub.

                  I agree.

                  1 Reply Last reply
                  0
                  • activitypub@community.nodebb.orgA activitypub@community.nodebb.org shared this topic for 30 dage siden
                  • A angus@socialhub.activitypub.rocks
                    for 30 dage siden

                    @julian I'm focusing on Deletion (both Notes and Actors) in Discourse at the moment and I'm thinking of essentially adopting the approach you've outlined here. Have there been any updates to your approach since you wrote this?

                    J This user is from outside of this forum
                    J This user is from outside of this forum
                    julian@community.nodebb.org
                    wrote for 27 dage siden sidst redigeret af
                    #11

                    No, there have been no major concerns arising out of this.

                    A couple observations:

                    1. There is a mismatch between what other instances expect for deletions and what actually happens. A Mastodon user deleting post expects it to be gone for good, but on our end it will simply be soft deleted. This isn’t a major issue, it just means admins get to see all the deleted stuff (useful when people say hurtful things, delete them, and pretend they never happened.) Even then it’s only a small percentage, most of the deleted stuff I see are for fixing typos.
                    2. I am reasonably sure that nobody else besides NodeBB (and now Discourse) knows what to do with an Update(Tombstone), so nothing happens. It means soft deleted posts on our end are essentially ignored and still visible.

                    The latter may actually be a concern and warrant an admin-side option to explicitly federate out a Delete.

                    jdp23@socialhub.activitypub.rocksJ 1 Reply Last reply for 25 dage siden
                    0
                    • A This user is from outside of this forum
                      A This user is from outside of this forum
                      angus@socialhub.activitypub.rocks
                      wrote for 27 dage siden sidst redigeret af
                      #12

                      Thanks for clarifying.

                      julian:
                      1. I am reasonably sure that nobody else besides NodeBB (and now Discourse) knows what to do with an Update(Tombstone), so nothing happens. It means soft deleted posts on our end are essentially ignored and still visible.

                      The latter may actually be a concern and warrant an admin-side option to explicitly federate out a Delete.

                      Yeah, I'm currently weighing this one. I'm wondering whether Update(Tombstone) really makes sense. I can see why you took that approach. I'm just mulling the implications, particularly

                      julian:

                      It means soft deleted posts on our end are essentially ignored and still visible.

                      I'm currently thinking users may find this surprising and it may interfere with things like moderation. But I'm still mulling it.

                      J 1 Reply Last reply for 27 dage siden
                      0
                      • A angus@socialhub.activitypub.rocks
                        for 27 dage siden

                        Thanks for clarifying.

                        julian:
                        1. I am reasonably sure that nobody else besides NodeBB (and now Discourse) knows what to do with an Update(Tombstone), so nothing happens. It means soft deleted posts on our end are essentially ignored and still visible.

                        The latter may actually be a concern and warrant an admin-side option to explicitly federate out a Delete.

                        Yeah, I'm currently weighing this one. I'm wondering whether Update(Tombstone) really makes sense. I can see why you took that approach. I'm just mulling the implications, particularly

                        julian:

                        It means soft deleted posts on our end are essentially ignored and still visible.

                        I'm currently thinking users may find this surprising and it may interfere with things like moderation. But I'm still mulling it.

                        J This user is from outside of this forum
                        J This user is from outside of this forum
                        julian@community.nodebb.org
                        wrote for 27 dage siden sidst redigeret af
                        #13

                        I can look into putting together an FEP for this. It would solidify the concepts and open it up for wider discussion if necessary.

                        1 Reply Last reply
                        0
                        • A This user is from outside of this forum
                          A This user is from outside of this forum
                          angus@socialhub.activitypub.rocks
                          wrote for 27 dage siden sidst redigeret af
                          #14

                          tbh the more I think about this, the more it feels like federating Update(Tombstone) is never going to work very well.

                          We'd first have to win the argument that federating Tombstones make sense at all. I found the arguments to the contrary relatively persuasive on that front (I know you're aware of this, but just giving context for other folks reading this):

                          https://socialhub.activitypub.rocks/t/the-delete-activity-and-its-misconceptions/137

                          I wonder if we can't just do point 6 on your list:

                          If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:

                          • If we see an as:Tombstone, we will delete the post (soft delete)
                          • If we encounter a 404 or 410, we will purge the post (hard delete)

                          So to play that out:

                          PublisherPost is deleted

                          1. On soft delete:
                            • Convert (Note|Article) to Tombstone
                            • Federate Delete(Note|Article)
                          2. On hard delete:
                            • Delete (Note|Article)
                            • Federate Delete(Note|Article)

                          ReceiverReceives Delete(Note|Article)

                          1. Remote (Note|Article) returns Tombstone
                            • Convert (Note|Article) to Tombstone
                            • Soft-delete associated post.
                          2. Remote (Note|Article) returns 404 (or 410)
                            • Delete (Note|Article)
                            • Hard-delete associated post.
                          J 1 Reply Last reply for 26 dage siden
                          0
                          • A angus@socialhub.activitypub.rocks
                            for 27 dage siden

                            tbh the more I think about this, the more it feels like federating Update(Tombstone) is never going to work very well.

                            We'd first have to win the argument that federating Tombstones make sense at all. I found the arguments to the contrary relatively persuasive on that front (I know you're aware of this, but just giving context for other folks reading this):

                            https://socialhub.activitypub.rocks/t/the-delete-activity-and-its-misconceptions/137

                            I wonder if we can't just do point 6 on your list:

                            If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:

                            • If we see an as:Tombstone, we will delete the post (soft delete)
                            • If we encounter a 404 or 410, we will purge the post (hard delete)

                            So to play that out:

                            PublisherPost is deleted

                            1. On soft delete:
                              • Convert (Note|Article) to Tombstone
                              • Federate Delete(Note|Article)
                            2. On hard delete:
                              • Delete (Note|Article)
                              • Federate Delete(Note|Article)

                            ReceiverReceives Delete(Note|Article)

                            1. Remote (Note|Article) returns Tombstone
                              • Convert (Note|Article) to Tombstone
                              • Soft-delete associated post.
                            2. Remote (Note|Article) returns 404 (or 410)
                              • Delete (Note|Article)
                              • Hard-delete associated post.
                            J This user is from outside of this forum
                            J This user is from outside of this forum
                            julian@community.nodebb.org
                            wrote for 26 dage siden sidst redigeret af
                            #15

                            Agreed. That makes sense since receiving a Delete should trigger a cache invalidation, so there’s no reason it need be a different activity. I will make the appropriate changes soon.

                            1 Reply Last reply
                            0
                            • J This user is from outside of this forum
                              J This user is from outside of this forum
                              julian@community.nodebb.org
                              wrote for 26 dage siden sidst redigeret af
                              #16

                              Angus, while I haven’t made the appropriate changes to NodeBB’s implementation yet, I did draft an FEP including the changes we discussed.

                              https://github.com/julianlam/feps/blob/main/fep/15c5/fep-15c5.md

                              It is not PR’d upstream yet, but I will do so in the coming days unless there are some concerns.

                              1 Reply Last reply
                              0
                              • trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                                trwnh@socialhub.activitypub.rocksT This user is from outside of this forum
                                trwnh@socialhub.activitypub.rocks
                                wrote for 26 dage siden sidst redigeret af
                                #17

                                I recognize that this makes the Delete activity work differently for S2S than it does C2S, which is to say that a user or client cannot distinguish between "soft delete" and "hard delete" this way. Otherwise, the "cache invalidation" idea is a sensible one.

                                mro@digitalcourage.socialM 1 Reply Last reply for 26 dage siden
                                0
                                • trwnh@socialhub.activitypub.rocksT trwnh@socialhub.activitypub.rocks
                                  for 26 dage siden

                                  I recognize that this makes the Delete activity work differently for S2S than it does C2S, which is to say that a user or client cannot distinguish between "soft delete" and "hard delete" this way. Otherwise, the "cache invalidation" idea is a sensible one.

                                  mro@digitalcourage.socialM This user is from outside of this forum
                                  mro@digitalcourage.socialM This user is from outside of this forum
                                  mro@digitalcourage.social
                                  wrote for 26 dage siden sidst redigeret af
                                  #18

                                  Hi @trwnh,
                                  I'd prefer expiry + renewal over cache invalidation or deletion every time. https://www.w3.org/TR/activitystreams-vocabulary/#dfn-endtime

                                  This way data sets could also auto-clean abandoned actors and servers.

                                  1 Reply Last reply
                                  0
                                  • J julian@community.nodebb.org
                                    for 27 dage siden

                                    No, there have been no major concerns arising out of this.

                                    A couple observations:

                                    1. There is a mismatch between what other instances expect for deletions and what actually happens. A Mastodon user deleting post expects it to be gone for good, but on our end it will simply be soft deleted. This isn’t a major issue, it just means admins get to see all the deleted stuff (useful when people say hurtful things, delete them, and pretend they never happened.) Even then it’s only a small percentage, most of the deleted stuff I see are for fixing typos.
                                    2. I am reasonably sure that nobody else besides NodeBB (and now Discourse) knows what to do with an Update(Tombstone), so nothing happens. It means soft deleted posts on our end are essentially ignored and still visible.

                                    The latter may actually be a concern and warrant an admin-side option to explicitly federate out a Delete.

                                    jdp23@socialhub.activitypub.rocksJ This user is from outside of this forum
                                    jdp23@socialhub.activitypub.rocksJ This user is from outside of this forum
                                    jdp23@socialhub.activitypub.rocks
                                    wrote for 25 dage siden sidst redigeret af
                                    #19

                                    It's not a NodeBB in particular but it's worth mentioning another mismatch: Misskey and forks will also delete replies when a post is deleted.

                                    1 Reply Last reply
                                    0
                                    • J julian@community.nodebb.org
                                      8. maj 2024, 14.09

                                      For a lot of things in ActivityPub, there are almost direct parallels in NodeBB. An as:Note object pairs well with a NodeBB post, an as:Person is a NodeBB user, etc.

                                      One thing that didn’t map 1:1 was the Delete activity, which at surface level, seems rather straightforward — just delete the object! However, once you dig in, there are some additional considerations:

                                      • in NodeBB, we have two separate states for content removal.
                                        • A delete, where the post is still present (but its content unavailable to non-privileged users), and a
                                        • A purge, where the post is scrubbed from the database entirely, and all references to it, removed
                                      • in ActivityPub, there is a single activity, as:Delete
                                      • Implementors may opt to replace the object representation with an as:Tombstone (how quaint!), but they may also just opt to use a 404

                                      So there are some nuances that are left intentionally vague.

                                      Kaniini on SocialHub makes the argument that a Delete should be treated like a cache invalidation, which has its own merits.


                                      This is how NodeBB will interpret the protocol specification, and how we will align it with our own dual-state post deletion mechanic (delete & purge):

                                      1. When a local post is deleted, we will federate out an Update(Tombstone) referencing the id
                                      2. Afterwards, if the content is retrieved, an as:Tombstone will be served.
                                        • Deleted posts in NodeBB still maintain their place in the topic, so when the context is retrieved, the note will still be present in the collection.
                                      3. If we receive an Update(Tombstone), we will delete the local representation of the post
                                      4. When a local post is purged, we will federate out a Delete(Note)
                                      5. Afterwards, if the content is retrieved, we will serve a 404
                                        • The note will no longer exist in the context collection
                                      6. If we receive a Delete(Note) (or Article, or Question, etc.) we will not delete it immediately. Instead, as kaniini advises, we will attempt to retrieve the object from the origin:
                                        • If we see an as:Tombstone, we will delete the post (soft delete)
                                        • If we encounter a 404 or 410, we will purge the post (hard delete)

                                      I’m writing this out less as a guideline for myself, but to solicit opinions and to give others a chance to point out if I’ve interpreted the spec incorrectly.

                                      ? Offline
                                      ? Offline
                                      Gæst
                                      wrote for 9 dage siden sidst redigeret af
                                      #20

                                      A little semantics thing: I'd argue that HTTP 410 and as:Tombstone are semantically equivalent, i.e.

                                      • an as:Tombstone should always be served with the HTTP 410 status, and
                                      • A HTTP 410 status should be treated as a tombstone

                                      Software unaware of tombstones will then treat it as a hard delete. "Fully" tombstone aware software can then use logic like

                                      if (status == 200 && contentType is as2) { // treat as normal} else if (status == 410 && contentType is as2 &&  in body.type) { // also treat as normal} else if (status == 410) { // synthesize a tombstone} else if (status == 404) { // hard delete?} else // existing error handling logic
                                      1 Reply Last reply
                                      0
                                      Svar
                                      • Svar som emne
                                      Login for at svare
                                      • Ældste til nyeste
                                      • Nyeste til ældste
                                      • Most Votes


                                      • Log ind

                                      • Har du ikke en konto? Tilmeld

                                      • Login or register to search.
                                      Powered by NodeBB Contributors
                                      Graciously hosted by data.coop
                                      • First post
                                        Last post
                                      0
                                      • Hjem
                                      • Seneste
                                      • Etiketter
                                      • Populære
                                      • Verden
                                      • Bruger
                                      • Grupper