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

  1. Home
  2. uncategorized
  3. Today is a "I call an external service and it should return X, but it gives me Y instead even though I looked at the code and there's no way it should do that" kind of day

Today is a "I call an external service and it should return X, but it gives me Y instead even though I looked at the code and there's no way it should do that" kind of day

Scheduled Pinned Locked Moved uncategorized
10 Posts 5 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.
  • volpeon@icy.wyvern.ripV This user is from outside of this forum
    volpeon@icy.wyvern.ripV This user is from outside of this forum
    volpeon@icy.wyvern.rip
    wrote last edited by
    #1

    Today is a "I call an external service and it should return X, but it gives me Y instead even though I looked at the code and there's no way it should do that" kind of day

    volpeon@icy.wyvern.ripV 1 Reply Last reply
    0
    • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

      Today is a "I call an external service and it should return X, but it gives me Y instead even though I looked at the code and there's no way it should do that" kind of day

      volpeon@icy.wyvern.ripV This user is from outside of this forum
      volpeon@icy.wyvern.ripV This user is from outside of this forum
      volpeon@icy.wyvern.rip
      wrote last edited by
      #2

      This is the situation:
      - There are routes /a and /b which return X and Y respectively
      - Both call the same function, but with one parameter different which determines if it's X or Y
      - The function filters the data two times (in the database query and afterwards with Array.filter()) to ensure it adheres to the parameter
      - I call /b, but it gives me X
      - The logs on that service confirm I called /b

      ? ? papush@outerheaven.clubP volpeon@icy.wyvern.ripV 4 Replies Last reply
      0
      • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

        This is the situation:
        - There are routes /a and /b which return X and Y respectively
        - Both call the same function, but with one parameter different which determines if it's X or Y
        - The function filters the data two times (in the database query and afterwards with Array.filter()) to ensure it adheres to the parameter
        - I call /b, but it gives me X
        - The logs on that service confirm I called /b

        ? Offline
        ? Offline
        Guest
        wrote last edited by
        #3

        @volpeon@icy.wyvern.rip function is not called with the correct parameter?

        volpeon@icy.wyvern.ripV 1 Reply Last reply
        0
        • ? Guest

          @volpeon@icy.wyvern.rip function is not called with the correct parameter?

          volpeon@icy.wyvern.ripV This user is from outside of this forum
          volpeon@icy.wyvern.ripV This user is from outside of this forum
          volpeon@icy.wyvern.rip
          wrote last edited by volpeon@icy.wyvern.rip
          #4

          @eragon The route definition is literally

          request.query.type = "Y";
          await theFunction(request.params.customer, request.query);

          volpeon@icy.wyvern.ripV 1 Reply Last reply
          0
          • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

            @eragon The route definition is literally

            request.query.type = "Y";
            await theFunction(request.params.customer, request.query);

            volpeon@icy.wyvern.ripV This user is from outside of this forum
            volpeon@icy.wyvern.ripV This user is from outside of this forum
            volpeon@icy.wyvern.rip
            wrote last edited by
            #5

            @eragon I bet the query object is readonly. I'll tell the guy who developed the service ​​

            kura@hai.z0ne.socialK 1 Reply Last reply
            0
            • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

              This is the situation:
              - There are routes /a and /b which return X and Y respectively
              - Both call the same function, but with one parameter different which determines if it's X or Y
              - The function filters the data two times (in the database query and afterwards with Array.filter()) to ensure it adheres to the parameter
              - I call /b, but it gives me X
              - The logs on that service confirm I called /b

              ? Offline
              ? Offline
              Guest
              wrote last edited by
              #6

              @volpeon possibly some caching error? Is there any memoisation?

              1 Reply Last reply
              0
              • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

                This is the situation:
                - There are routes /a and /b which return X and Y respectively
                - Both call the same function, but with one parameter different which determines if it's X or Y
                - The function filters the data two times (in the database query and afterwards with Array.filter()) to ensure it adheres to the parameter
                - I call /b, but it gives me X
                - The logs on that service confirm I called /b

                papush@outerheaven.clubP This user is from outside of this forum
                papush@outerheaven.clubP This user is from outside of this forum
                papush@outerheaven.club
                wrote last edited by
                #7
                @volpeon you
                forgot one crucial element: software is inherently evil
                1 Reply Last reply
                0
                • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

                  @eragon I bet the query object is readonly. I'll tell the guy who developed the service ​​

                  kura@hai.z0ne.socialK This user is from outside of this forum
                  kura@hai.z0ne.socialK This user is from outside of this forum
                  kura@hai.z0ne.social
                  wrote last edited by
                  #8

                  @eragon@pl.eragon.re @volpeon@icy.wyvern.rip Javascript, amirite bois?

                  1 Reply Last reply
                  0
                  • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

                    This is the situation:
                    - There are routes /a and /b which return X and Y respectively
                    - Both call the same function, but with one parameter different which determines if it's X or Y
                    - The function filters the data two times (in the database query and afterwards with Array.filter()) to ensure it adheres to the parameter
                    - I call /b, but it gives me X
                    - The logs on that service confirm I called /b

                    volpeon@icy.wyvern.ripV This user is from outside of this forum
                    volpeon@icy.wyvern.ripV This user is from outside of this forum
                    volpeon@icy.wyvern.rip
                    wrote last edited by
                    #9

                    I found the problem, and then another one. And now it returns an error 500 with the description "[Object object]". I don't think this part of the service was in any use before ​​

                    volpeon@icy.wyvern.ripV 1 Reply Last reply
                    0
                    • volpeon@icy.wyvern.ripV volpeon@icy.wyvern.rip

                      I found the problem, and then another one. And now it returns an error 500 with the description "[Object object]". I don't think this part of the service was in any use before ​​

                      volpeon@icy.wyvern.ripV This user is from outside of this forum
                      volpeon@icy.wyvern.ripV This user is from outside of this forum
                      volpeon@icy.wyvern.rip
                      wrote last edited by
                      #10

                      Also my colleague who wrote this clearly took inspiration from Go. A lot of parts are

                      let [result, err] = call();
                      if (err) {
                          throw err;
                      }

                      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
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups