Comments (5)
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.
@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.
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.
https://github.com/untangled-web/untangled-client/pull/26/files
from untangled-client.
tested works
from untangled-client.
Related Issues (20)
- Would like remote mutation response in post-mutation multimethod HOT 2
- Enhancement: Support viewer needs two kinds of compression
- Enhancement: Support viewer needs Facelift HOT 1
- Merging a not-found ident join crashes HOT 1
- Support externally supplied atom with InitialAppState
- Enhancement: Make it possible to have load-data place the load marker in custom app-state locations HOT 3
- Union queries with InitialAppState seem to break normalization with 0.5.8-SNAPSHOT HOT 3
- Enhancement: Support custom transit handlers HOT 1
- Links to untangled tutorial return 404 HOT 3
- Data fetch markers being left after union merge with no data HOT 2
- Merge of nested union's InitialAppState is broken HOT 1
- app state passed to global error callback does not have the `:untangled/server-error` in that app state. HOT 3
- Regression? 0.8.0-SNAPSHOT sweep merge might not be working HOT 1
- Allow custom reconciler options HOT 1
- `split-items-ready-to-load` reorders reads in the outgoing remote transaction HOT 2
- Feature: Ability to chain parsers HOT 1
- Bug: Loading by ident does not use proper merge HOT 1
- Load marker stomps on data if it's a not normalized map HOT 1
- remote same-named mutations in a single tx should be split to separate network requests HOT 1
- Devcards support hot code reload loses state HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from untangled-client.