Git Product home page Git Product logo

Comments (5)

jasonjckn avatar jasonjckn commented on July 16, 2024

i've confirmed the bug is also reproducible with back-to-back load-field

                        (df/load-field T :hits2 :marker false)
                        (df/load-field T :hits3 :marker false)

from untangled-client.

jasonjckn avatar jasonjckn commented on July 16, 2024

@awkay I tried taking a wack at this but only got half way towards the fix.
jasonjckn@2bc82b2

the problem with the above is that in a 2x load-field-action inside a single mutation, one of the load-field-actions remain unprocessed in :om.next/ready-to-load

from untangled-client.

jasonjckn avatar jasonjckn commented on July 16, 2024

let's say you do the optimized version where if the Q contains 2 items with the same key, you merge the subquery, is it really that hard to get right?

consider my parser

(defmethod api-read :entitlements
  [{:keys [parser query] :as env} key params]
  {:value (parser env query)})

(defmethod api-read :ent-profile
  [env key {:keys [sso-id]}]
  {:value (auth/profile-by-id! sso-id)})

(defmethod api-read :ent-details
  [env key {:keys [sso-id]}]
  {:value (auth/entitlements-by-id! sso-id)})

 

the problem is my backend parser api-read :entitlements is called twice with 2 different queries, even though the client merged them, such that my LOG output on the backend is

16-08-17 23:49:31 fabric INFO [admin.system:21] - Read Request: [ :entitlements [(:ent-details {:sso-id "54d2497fe3e8d00800893017"})]] 
16-08-17 23:49:31 fabric INFO [admin.system:21] - Recursive Read Request: [ :ent-details  ] ({:sso-id "54d2497fe3e8d00800893017"})
16-08-17 23:49:45 fabric INFO [admin.system:21] - Read Request: [ :entitlements [(:ent-profile {:sso-id "54d2497fe3e8d00800893017"})]] 
16-08-17 23:49:45 fabric INFO [admin.system:21] - Recursive Read Request: [ :ent-profile  ] ({:sso-id "54d2497fe3e8d00800893017"})

The backend got 2 read requests even though the client ‘merged’ them. If instead we just have a single read request into api-read :entitlements in the backend, this would also fix the issue. Then the LOG output would be

16-08-17 23:49:31 fabric INFO [admin.system:21] - Read Request: [ :entitlements [(:ent-details {:sso-id "54d2497fe3e8d00800893017"})
                                                                              (:ent-profile {:sso-id "54d2497fe3e8d00800893017"})]] 
16-08-17 23:49:31 fabric INFO [admin.system:21] - Recursive Read Request: [ :ent-details  ] ({:sso-id "54d2497fe3e8d00800893017"})
16-08-17 23:49:45 fabric INFO [admin.system:21] - Recursive Read Request: [ :ent-profile  ] ({:sso-id "54d2497fe3e8d00800893017"})

my understanding of the issue with the optimized version is the  "missing keys / ::om-plumbing/not-found" code see's a focused query from merged items-to-load, but the backend sees separate read requests for each item to load

from untangled-client.

jasonjckn avatar jasonjckn commented on July 16, 2024

https://github.com/untangled-web/untangled-client/pull/26/files

from untangled-client.

jasonjckn avatar jasonjckn commented on July 16, 2024

tested works

from untangled-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.