@ai-matrx/records 0.84.3 → 0.84.4
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/CHANGELOG.md +6 -0
- package/dist/app-table/index.cjs +14 -1
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.js +14 -1
- package/dist/app-table/index.js.map +1 -1
- package/dist/core/index.cjs +14 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +14 -1
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +14 -1
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +14 -1
- package/dist/data/index.js.map +1 -1
- package/dist/react/index.cjs +14 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +14 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/data/index.cjs
CHANGED
|
@@ -2779,6 +2779,7 @@ function createRecordsClient(given) {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
return takePrimedDoorAnswer(`${door}|${canonicalArgs(args)}`);
|
|
2781
2781
|
}
|
|
2782
|
+
const readsInFlight = /* @__PURE__ */ new Map();
|
|
2782
2783
|
async function callDoor(door, args, where) {
|
|
2783
2784
|
const primed = primedFor(door, args);
|
|
2784
2785
|
if (primed) return ok(primed.data);
|
|
@@ -2789,7 +2790,19 @@ function createRecordsClient(given) {
|
|
|
2789
2790
|
scream({ code: refusal2.code, message: refusal2.message, ...refusal2.hint ? { hint: refusal2.hint } : {}, where });
|
|
2790
2791
|
return err(refusal2);
|
|
2791
2792
|
}
|
|
2792
|
-
const
|
|
2793
|
+
const flightKey = isWritingDoor(door) ? null : `${door}|${canonicalArgs(args)}`;
|
|
2794
|
+
const flying = flightKey ? readsInFlight.get(flightKey) : void 0;
|
|
2795
|
+
const response = await (flying ?? (() => {
|
|
2796
|
+
const call = Promise.resolve(config.dataSource.rpc(`${door}`, args, { schema }));
|
|
2797
|
+
if (flightKey) {
|
|
2798
|
+
readsInFlight.set(flightKey, call);
|
|
2799
|
+
const forget = () => {
|
|
2800
|
+
if (readsInFlight.get(flightKey) === call) readsInFlight.delete(flightKey);
|
|
2801
|
+
};
|
|
2802
|
+
call.then(forget, forget);
|
|
2803
|
+
}
|
|
2804
|
+
return call;
|
|
2805
|
+
})());
|
|
2793
2806
|
if (response.error) {
|
|
2794
2807
|
const refusal2 = mapPgError(response.error, where);
|
|
2795
2808
|
scream({ code: refusal2.code, message: refusal2.message, ...refusal2.hint ? { hint: refusal2.hint } : {}, where });
|