• 18 Posts
  • 22 Comments
Joined 1 month ago
cake
Cake day: June 2nd, 2024

help-circle


  • bleistift2@sopuli.xyzOPtoich_iel@feddit.orgich🍕iel
    link
    fedilink
    Deutsch
    arrow-up
    6
    ·
    1 day ago

    Die Erklärung steht in der Pfosten-Beschreibung. Nach meinem initialen Schwall hat die Sache aber irgendwie ein Eigenleben entwickelt.

    (Zangendeutsche jetzt wegsehen)

    The explanation is in the post description. After my initial burst of memes, this topic seems to have taken on a life of its own…


  • Frankly that there isn’t a specific field signalling authorized/not-authorized

    The instance I was bitching about was this: There’s a lot of region-specific data coming from the backend. But the user is only authorized for certain regions. So for instance the North-American guy gets this object: { "CA": [/* list of stuff */], "US": [/* list of stuff */], "MX": [ /* list of stuff */ ]}, while the US-only guy only gets {"US": [ /* list of stuff */] }. Are you suggesting that the response should also include flags isCaPresent, isUsPresent, isMxPresent for every country?

    The issue with null vs not present surfaced because I, the frontend, checked if the returned object contained the key "CA" and then tried to iterate over the list of stuff, which happened to be null, which is hard to iterate over. I agree that I could’ve checked if the key was present and not null.

    The meme, however, was lamenting that the backend developer, refuses to acknowledge that these two JSONs are different,since they only see their POJOs, where both map to CA: null, US: [], MX: null.




  • So it sounds like an issue with […] handling per-spec the presence of data which you don’t use.

    The trouble is, in this specific use case, the data may either be there or it may not be, depending on authorization. I’m checking specifically if the key is present to determine whether the user has access to that data (and display a toggle for that data), or if the user mustn’t see it and thus doesn’t need the toggle.

    The wrong assumption was that if the key is there, then the value is not null. That assumption was invalidated by an update on the server side. Of course I could’ve checked if the value of the key is nullish. But it’s still annoying to have a breaking frontend because the backend changed how it serves its data.























  • bleistift2@sopuli.xyztoich_iel@feddit.orgich iel
    link
    fedilink
    Deutsch
    arrow-up
    1
    ·
    2 days ago

    Außerdem ist es nicht redundant, weil die Anbieter ihre Netze nicht untereinander teilen.

    Du musst die Redundanz kaufen. Firmen machen das teilweise so und buchen bei verschiedenen Anbietern Internetanschlüsse. Die Freude ist groß, wenn man dann herausfindet, dass die Anbieter die Kabel doch geteilt haben und tatsächlich einmal falsch Baggern reicht, um beide Anschlüsse lahmzulegen.


  • Indeed, and that turns out to be a problem if the JavaScript expects the key not to be there, but instead it is there. And then you try to tell the backend dev that the key shouldn’t be there, but he’ll try to convince you that it’s the same whether the key is not there or whether it’s assigned null and then you wonder if he’s messing with you, but actually he isn’t and then the only thing keeping you sane is bitching about it in meme form on lemmy.