Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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

  1. Home
  2. Technical Discussion
  3. NodeBB <> Lemmy federation issue (re: nullable image/icon)

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

Scheduled Pinned Locked Moved Technical Discussion
lemmynodebbactivitypub
26 Posts 4 Posters 0 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.
  • trwnh@mastodon.socialT 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.spaceJ This user is from outside of this forum
    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.space
    wrote last edited by
    #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 Reply Last reply
    0
    • trwnh@mastodon.socialT This user is from outside of this forum
      trwnh@mastodon.socialT This user is from outside of this forum
      trwnh@mastodon.social
      wrote last edited by
      #18

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

      julian@activitypub.spaceJ 1 Reply Last reply
      0
      • trwnh@mastodon.socialT trwnh@mastodon.social

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

        julian@activitypub.spaceJ This user is from outside of this forum
        julian@activitypub.spaceJ This user is from outside of this forum
        julian@activitypub.space
        wrote last edited by
        #19

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

        trwnh@mastodon.socialT 1 Reply Last reply
        0
        • julian@activitypub.spaceJ julian@activitypub.space

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

          trwnh@mastodon.socialT This user is from outside of this forum
          trwnh@mastodon.socialT This user is from outside of this forum
          trwnh@mastodon.social
          wrote last edited by
          #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.spaceJ 1 Reply Last reply
          0
          • trwnh@mastodon.socialT trwnh@mastodon.social

            @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.spaceJ This user is from outside of this forum
            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.space
            wrote last edited by
            #21

            trwnh@mastodon.social as someone working on the consuming side, that is not correct.

            If my AP lib automatically assumed null when requesting an object property that didn't exist I'd consider that a bug.

            1 Reply Last reply
            0
            • trwnh@mastodon.socialT This user is from outside of this forum
              trwnh@mastodon.socialT This user is from outside of this forum
              trwnh@mastodon.social
              wrote last edited by
              #22

              @julian this wouldn't be your AP lib, it would be your programming language itself

              julian@activitypub.spaceJ 1 Reply Last reply
              0
              • trwnh@mastodon.socialT trwnh@mastodon.social

                @julian this wouldn't be your AP lib, it would be your programming language itself

                julian@activitypub.spaceJ This user is from outside of this forum
                julian@activitypub.spaceJ This user is from outside of this forum
                julian@activitypub.space
                wrote last edited by
                #23

                trwnh@mastodon.social I'm coding in js, which has all sorts of footguns, but even that won't return null when I attempt to access the non-existent property of an object... ๐Ÿ˜›

                1 Reply Last reply
                0
                • trwnh@mastodon.socialT This user is from outside of this forum
                  trwnh@mastodon.socialT This user is from outside of this forum
                  trwnh@mastodon.social
                  wrote last edited by
                  #24

                  @julian what does js return instead? in most cases i'm familiar with, programming languages use null or nil or None for anything that doesn't have a value, or any reference which doesn't point anywhere. hence a null pointer exception when you try to dereference a null. if you try to get a value for a key that isn't in the dictionary, you get null by default because there is no value for a missing key. how would you consume a null value? if you have nothing to say, why say anything?

                  julian@activitypub.spaceJ 1 Reply Last reply
                  0
                  • trwnh@mastodon.socialT trwnh@mastodon.social

                    @julian what does js return instead? in most cases i'm familiar with, programming languages use null or nil or None for anything that doesn't have a value, or any reference which doesn't point anywhere. hence a null pointer exception when you try to dereference a null. if you try to get a value for a key that isn't in the dictionary, you get null by default because there is no value for a missing key. how would you consume a null value? if you have nothing to say, why say anything?

                    julian@activitypub.spaceJ This user is from outside of this forum
                    julian@activitypub.spaceJ This user is from outside of this forum
                    julian@activitypub.space
                    wrote last edited by
                    #25

                    trwnh@mastodon.social undefined and perhaps that's why we're disagreeing on our interpretations of how these values should be handled.

                    null in JavaScript is very explicitly a declaration that there is no value or "intentionally empty".

                    null and undefined are two separate things here at least.

                    1 Reply Last reply
                    0
                    • trwnh@mastodon.socialT This user is from outside of this forum
                      trwnh@mastodon.socialT This user is from outside of this forum
                      trwnh@mastodon.social
                      wrote last edited by
                      #26

                      @julian that might be it, yeah. languages outside of javascript generally don't make a distinction between null and undefined, and even in javascript these are used inconsistently. for example localStorage.getItem will return null for a missing key. practically speaking, the "intentionally" distinction is a distinction without a difference in most processing contexts.

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


                      • Login

                      • Don't have an account? Register

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