@odatano/core 2.0.0-rc.2 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/srv/cardano-service.js +10 -6
package/package.json
CHANGED
package/srv/cardano-service.js
CHANGED
|
@@ -76,12 +76,16 @@ function indexOnMissRead(entity, reqKeyField, validate, indexFn, options) {
|
|
|
76
76
|
// Populate the row (+ compositions) on a miss, then let CAP run the client's
|
|
77
77
|
// query — one extra SELECT per keyed read, but $expand/$select (and the
|
|
78
78
|
// temporal filter of the projection) apply exactly as on the un-keyed path.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
|
|
79
|
+
if (!existing)
|
|
80
|
+
await indexFn(db, key);
|
|
81
|
+
// The client's query is the ONLY authority on what comes back. Falling back
|
|
82
|
+
// to `existing` (or the indexer's return value) when it matches nothing
|
|
83
|
+
// answers a request the client never made — a second key that does not
|
|
84
|
+
// match, or an excluding $filter, would get a sibling row with a 200
|
|
85
|
+
// instead of a 404 (KNOWN_ISSUES #15). Non-temporal entities always see
|
|
86
|
+
// their fresh rows here; temporal ones rely on widenTemporalWindow above,
|
|
87
|
+
// and if that ever stops working the failure is a loud 404 covered by
|
|
88
|
+
// test/integration/keyed-read-expand.test.ts, not silently wrong data.
|
|
85
89
|
}
|
|
86
90
|
return db.run(req.query);
|
|
87
91
|
});
|