@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.js
CHANGED
|
@@ -2735,6 +2735,7 @@ function createRecordsClient(given) {
|
|
|
2735
2735
|
}
|
|
2736
2736
|
return takePrimedDoorAnswer(`${door}|${canonicalArgs(args)}`);
|
|
2737
2737
|
}
|
|
2738
|
+
const readsInFlight = /* @__PURE__ */ new Map();
|
|
2738
2739
|
async function callDoor(door, args, where) {
|
|
2739
2740
|
const primed = primedFor(door, args);
|
|
2740
2741
|
if (primed) return ok(primed.data);
|
|
@@ -2745,7 +2746,19 @@ function createRecordsClient(given) {
|
|
|
2745
2746
|
scream({ code: refusal2.code, message: refusal2.message, ...refusal2.hint ? { hint: refusal2.hint } : {}, where });
|
|
2746
2747
|
return err(refusal2);
|
|
2747
2748
|
}
|
|
2748
|
-
const
|
|
2749
|
+
const flightKey = isWritingDoor(door) ? null : `${door}|${canonicalArgs(args)}`;
|
|
2750
|
+
const flying = flightKey ? readsInFlight.get(flightKey) : void 0;
|
|
2751
|
+
const response = await (flying ?? (() => {
|
|
2752
|
+
const call = Promise.resolve(config.dataSource.rpc(`${door}`, args, { schema }));
|
|
2753
|
+
if (flightKey) {
|
|
2754
|
+
readsInFlight.set(flightKey, call);
|
|
2755
|
+
const forget = () => {
|
|
2756
|
+
if (readsInFlight.get(flightKey) === call) readsInFlight.delete(flightKey);
|
|
2757
|
+
};
|
|
2758
|
+
call.then(forget, forget);
|
|
2759
|
+
}
|
|
2760
|
+
return call;
|
|
2761
|
+
})());
|
|
2749
2762
|
if (response.error) {
|
|
2750
2763
|
const refusal2 = mapPgError(response.error, where);
|
|
2751
2764
|
scream({ code: refusal2.code, message: refusal2.message, ...refusal2.hint ? { hint: refusal2.hint } : {}, where });
|