Salta al contenuto
0
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Old Web Site
  • Recenti
  • Popolare
  • Tag
  • Utenti
  • Home
  • Piero Bosio
  • Blog
  • Mondo
  • Fediverso
  • News
  • Categorie
  • Old Web Site
  • Recenti
  • Popolare
  • Tag
  • Utenti
Skin
  • Chiaro
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Scuro
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Predefinito (Nessuna skin)
  • Nessuna skin
Collassa

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone
  1. Home
  2. Categorie
  3. Technical Discussion
  4. NodeBB <> Lemmy federation issue (re: nullable image/icon)

NodeBB <> Lemmy federation issue (re: nullable image/icon)

Pianificato Fissato Bloccato Spostato Technical Discussion
lemmynodebbactivitypub
26 Post 4 Autori 154 Visualizzazioni
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • julian@activitypub.space
    julian@activitypub.space
    julian@activitypub.space
    scritto su ultima modifica di
    #1

    nutomic@lemmy.ml reported a federation issue with a NodeBB instance and we debugged it. It turns out Lemmy is unable to handle actors who have image or icon set to null.

    Lemmy is taking steps to handle this (source, source), and NodeBB will update its actor logic to omit properties without an avatar or cover photo set.

    1 Risposta Ultima Risposta
    1
    0
    • nodebb@fosstodon.org nodebb@fosstodon.org ha condiviso questa discussione su
    • evan@cosocial.ca
      evan@cosocial.ca
      evan@cosocial.ca
      scritto su ultima modifica di
      #2

      @julian @nutomic null values are bad in JSON-LD. We really have to avoid them. There are some bad references to `null` in the AP spec; they're likely to get removed sometime soon.

      julian@activitypub.space 1 Risposta Ultima Risposta
      1
      • evan@cosocial.ca evan@cosocial.ca

        @julian @nutomic null values are bad in JSON-LD. We really have to avoid them. There are some bad references to `null` in the AP spec; they're likely to get removed sometime soon.

        julian@activitypub.space
        julian@activitypub.space
        julian@activitypub.space
        scritto su ultima modifica di
        #3

        evan@cosocial.ca I had no idea that was the case. That is very good to know and having it called out in some sort of best practices doc (an existing w3c explainer?) would be helpful :smile:

        1 Risposta Ultima Risposta
        0
        • julian@activitypub.space
          julian@activitypub.space
          julian@activitypub.space
          scritto su ultima modifica di
          #4

          NodeBB v4.6.1 contains the fix so that if an avatar and cover photo are not set, they are not included in the ActivityPub actor data.

          1 Risposta Ultima Risposta
          0
          • trwnh@mastodon.social
            trwnh@mastodon.social
            trwnh@mastodon.social
            scritto su ultima modifica di
            #5

            @julian @evan aside from potentially causing null pointer exceptions when you try to dereference null, using null is equivalent to just leaving out the statement in the first place. there's no reason to use null. the only time you'd need null values is if your schema required a certain key to be present but allowed the value to be nullable, which is generally a bad idea compared to just making the key optional. tony hoare, the inventor of null, called it their "billion-dollar mistake".

            julian@activitypub.space 1 Risposta Ultima Risposta
            0
            • trwnh@mastodon.social trwnh@mastodon.social

              @julian @evan aside from potentially causing null pointer exceptions when you try to dereference null, using null is equivalent to just leaving out the statement in the first place. there's no reason to use null. the only time you'd need null values is if your schema required a certain key to be present but allowed the value to be nullable, which is generally a bad idea compared to just making the key optional. tony hoare, the inventor of null, called it their "billion-dollar mistake".

              julian@activitypub.space
              julian@activitypub.space
              julian@activitypub.space
              scritto su ultima modifica di
              #6

              trwnh@mastodon.social said in NodeBB <> Lemmy federation issue (re: nullable image/icon):
              > using null is equivalent to just leaving out the statement in the first place.

              That's not true, there are specific scenarios where having an explicit "no value" is significant vs "missing value"...

              1 Risposta Ultima Risposta
              0
              • evan@cosocial.ca
                evan@cosocial.ca
                evan@cosocial.ca
                scritto su ultima modifica di evan@cosocial.ca
                #7

                @julian @trwnh there are specifically processing problems with JSON-LD when an `id` property is `null`. I agree, we need better guidance. I'm adding an issue for it.

                https://github.com/w3c/activitystreams/issues/656

                1 Risposta Ultima Risposta
                0
                • trwnh@mastodon.social
                  trwnh@mastodon.social
                  trwnh@mastodon.social
                  scritto su ultima modifica di
                  #8

                  @julian if you give me any specific examples of when you would want to use null, i can recommend better alternatives. generally, it's always possible that there is missing information.

                  julian@activitypub.space 2 Risposte Ultima Risposta
                  0
                  • liaizon@social.wake.st
                    liaizon@social.wake.st
                    liaizon@social.wake.st
                    scritto su ultima modifica di
                    #9

                    @julian love to see the reports of cross project colab!

                    1 Risposta Ultima Risposta
                    0
                    • trwnh@mastodon.social trwnh@mastodon.social

                      @julian if you give me any specific examples of when you would want to use null, i can recommend better alternatives. generally, it's always possible that there is missing information.

                      julian@activitypub.space
                      julian@activitypub.space
                      julian@activitypub.space
                      scritto su ultima modifica di julian@activitypub.space
                      #10

                      trwnh@mastodon.social found one.

                      NodeBB uses audience to denote which audience an object (or context) belongs to.

                      Posts and Topics in NodeBB can belong to no context at all. null would be the way to communicate this, since omission might mean one isn't specified.

                      Likewise, a Move(Context) where a topic is moved out of a category but not into another. You probably shouldnt omit target there.

                      1 Risposta Ultima Risposta
                      0
                      • trwnh@mastodon.social
                        trwnh@mastodon.social
                        trwnh@mastodon.social
                        scritto su ultima modifica di
                        #11

                        @julian no, null is the same as nothing. what you want is more like [] (the empty set). in the case where you Move something without a target, you should be sending an Update instead.

                        trwnh@mastodon.social 1 Risposta Ultima Risposta
                        0
                        • trwnh@mastodon.social trwnh@mastodon.social

                          @julian no, null is the same as nothing. what you want is more like [] (the empty set). in the case where you Move something without a target, you should be sending an Update instead.

                          trwnh@mastodon.social
                          trwnh@mastodon.social
                          trwnh@mastodon.social
                          scritto su ultima modifica di
                          #12

                          @julian but more generally my question is, what practical application would you need to make use of an empty set []? like, a consumer encountering a value should do A, encountering a null or missing property should do B, encountering an empty set should do C... what is the difference between B and C?

                          julian@activitypub.space 1 Risposta Ultima Risposta
                          0
                          • trwnh@mastodon.social trwnh@mastodon.social

                            @julian but more generally my question is, what practical application would you need to make use of an empty set []? like, a consumer encountering a value should do A, encountering a null or missing property should do B, encountering an empty set should do C... what is the difference between B and C?

                            julian@activitypub.space
                            julian@activitypub.space
                            julian@activitypub.space
                            scritto su ultima modifica di
                            #13

                            trwnh@mastodon.social receiving a Move(Context) where target is null would tell NodeBB to move the topic to -1, uncategorized.

                            For those not supporting the catch-all bucket, deleting the context is ok too.

                            1 Risposta Ultima Risposta
                            0
                            • trwnh@mastodon.social
                              trwnh@mastodon.social
                              trwnh@mastodon.social
                              scritto su ultima modifica di
                              #14

                              @julian so this is still in effect a Remove or Update, not a Move. if you wanted it to be a Move, you would instead have an "uncategorized" category whose id is /categories/-1 or something like that.

                              1 Risposta Ultima Risposta
                              0
                              • trwnh@mastodon.social trwnh@mastodon.social

                                @julian if you give me any specific examples of when you would want to use null, i can recommend better alternatives. generally, it's always possible that there is missing information.

                                julian@activitypub.space
                                julian@activitypub.space
                                julian@activitypub.space
                                scritto su ultima modifica di
                                #15

                                trwnh@mastodon.social oh, another one.

                                Glitch-soc apparently lets you hide follower counts, and federates a -1. That works but null would be a more explicit statement that the follower collection is hidden/not accessible.

                                1 Risposta Ultima Risposta
                                0
                                • trwnh@mastodon.social
                                  trwnh@mastodon.social
                                  trwnh@mastodon.social
                                  scritto su ultima modifica di
                                  #16

                                  @julian leaving out the totalItems statement entirely would do the same thing. the problem is when you ignore the (lack of) information presented and synthesize your own.

                                  you could also define a vocab term for "hidden" or "unavailable", although this isn't much better than leaving it out in the first place

                                  julian@activitypub.space 1 Risposta Ultima Risposta
                                  0
                                  • trwnh@mastodon.social trwnh@mastodon.social

                                    @julian leaving out the totalItems statement entirely would do the same thing. the problem is when you ignore the (lack of) information presented and synthesize your own.

                                    you could also define a vocab term for "hidden" or "unavailable", although this isn't much better than leaving it out in the first place

                                    julian@activitypub.space
                                    julian@activitypub.space
                                    julian@activitypub.space
                                    scritto su ultima modifica di
                                    #17

                                    trwnh@mastodon.social leaving out totalitems is absolutely not the same as explicitly declaring a null value. You don't know whether the implementation just didn't send totalItems or whether it was omitted on purpose.

                                    1 Risposta Ultima Risposta
                                    0
                                    • trwnh@mastodon.social
                                      trwnh@mastodon.social
                                      trwnh@mastodon.social
                                      scritto su ultima modifica di
                                      #18

                                      @julian what's the difference between "not sending" vs "omitting"? those are synonyms

                                      julian@activitypub.space 1 Risposta Ultima Risposta
                                      0
                                      • trwnh@mastodon.social trwnh@mastodon.social

                                        @julian what's the difference between "not sending" vs "omitting"? those are synonyms

                                        julian@activitypub.space
                                        julian@activitypub.space
                                        julian@activitypub.space
                                        scritto su ultima modifica di
                                        #19

                                        trwnh@mastodon.social not sent due to implementation differences, rather.

                                        trwnh@mastodon.social 1 Risposta Ultima Risposta
                                        0
                                        • julian@activitypub.space julian@activitypub.space

                                          trwnh@mastodon.social not sent due to implementation differences, rather.

                                          trwnh@mastodon.social
                                          trwnh@mastodon.social
                                          trwnh@mastodon.social
                                          scritto su ultima modifica di
                                          #20

                                          @julian there's no difference on the consuming side (and in many programming languages you can check for truthiness with something like `if x.get("totalItems")` which defaults to returning null if missing anyway)

                                          functionally, you either have the information, or you don't

                                          julian@activitypub.space 1 Risposta Ultima Risposta
                                          0

                                          Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

                                          Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

                                          Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

                                          Registrati Accedi
                                          Rispondi
                                          • Risposta alla discussione
                                          Effettua l'accesso per rispondere
                                          • Da Vecchi a Nuovi
                                          • Da Nuovi a Vecchi
                                          • Più Voti


                                          • 1
                                          • 2
                                          Feed RSS
                                          NodeBB <> Lemmy federation issue (re: nullable image/icon)
                                          @pierobosio@soc.bosio.info
                                          NodeBB Contributors
                                          • Accedi

                                          • Accedi o registrati per effettuare la ricerca.
                                          • Primo post
                                            Ultimo post