@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/core/index.js
CHANGED
|
@@ -5993,6 +5993,7 @@ function createRecordsClient(given) {
|
|
|
5993
5993
|
}
|
|
5994
5994
|
return takePrimedDoorAnswer(`${door}|${canonicalArgs(args)}`);
|
|
5995
5995
|
}
|
|
5996
|
+
const readsInFlight = /* @__PURE__ */ new Map();
|
|
5996
5997
|
async function callDoor(door, args, where) {
|
|
5997
5998
|
const primed = primedFor(door, args);
|
|
5998
5999
|
if (primed) return ok(primed.data);
|
|
@@ -6003,7 +6004,19 @@ function createRecordsClient(given) {
|
|
|
6003
6004
|
scream({ code: refusal.code, message: refusal.message, ...refusal.hint ? { hint: refusal.hint } : {}, where });
|
|
6004
6005
|
return err(refusal);
|
|
6005
6006
|
}
|
|
6006
|
-
const
|
|
6007
|
+
const flightKey = isWritingDoor(door) ? null : `${door}|${canonicalArgs(args)}`;
|
|
6008
|
+
const flying = flightKey ? readsInFlight.get(flightKey) : void 0;
|
|
6009
|
+
const response = await (flying ?? (() => {
|
|
6010
|
+
const call = Promise.resolve(config.dataSource.rpc(`${door}`, args, { schema }));
|
|
6011
|
+
if (flightKey) {
|
|
6012
|
+
readsInFlight.set(flightKey, call);
|
|
6013
|
+
const forget = () => {
|
|
6014
|
+
if (readsInFlight.get(flightKey) === call) readsInFlight.delete(flightKey);
|
|
6015
|
+
};
|
|
6016
|
+
call.then(forget, forget);
|
|
6017
|
+
}
|
|
6018
|
+
return call;
|
|
6019
|
+
})());
|
|
6007
6020
|
if (response.error) {
|
|
6008
6021
|
const refusal = mapPgError(response.error, where);
|
|
6009
6022
|
scream({ code: refusal.code, message: refusal.message, ...refusal.hint ? { hint: refusal.hint } : {}, where });
|