@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/react/index.js
CHANGED
|
@@ -4277,6 +4277,7 @@ function createRecordsClient(given) {
|
|
|
4277
4277
|
}
|
|
4278
4278
|
return takePrimedDoorAnswer(`${door}|${canonicalArgs(args)}`);
|
|
4279
4279
|
}
|
|
4280
|
+
const readsInFlight = /* @__PURE__ */ new Map();
|
|
4280
4281
|
async function callDoor(door, args, where) {
|
|
4281
4282
|
const primed = primedFor(door, args);
|
|
4282
4283
|
if (primed) return ok(primed.data);
|
|
@@ -4287,7 +4288,19 @@ function createRecordsClient(given) {
|
|
|
4287
4288
|
scream({ code: refusal3.code, message: refusal3.message, ...refusal3.hint ? { hint: refusal3.hint } : {}, where });
|
|
4288
4289
|
return err(refusal3);
|
|
4289
4290
|
}
|
|
4290
|
-
const
|
|
4291
|
+
const flightKey = isWritingDoor(door) ? null : `${door}|${canonicalArgs(args)}`;
|
|
4292
|
+
const flying = flightKey ? readsInFlight.get(flightKey) : void 0;
|
|
4293
|
+
const response = await (flying ?? (() => {
|
|
4294
|
+
const call = Promise.resolve(config.dataSource.rpc(`${door}`, args, { schema }));
|
|
4295
|
+
if (flightKey) {
|
|
4296
|
+
readsInFlight.set(flightKey, call);
|
|
4297
|
+
const forget = () => {
|
|
4298
|
+
if (readsInFlight.get(flightKey) === call) readsInFlight.delete(flightKey);
|
|
4299
|
+
};
|
|
4300
|
+
call.then(forget, forget);
|
|
4301
|
+
}
|
|
4302
|
+
return call;
|
|
4303
|
+
})());
|
|
4291
4304
|
if (response.error) {
|
|
4292
4305
|
const refusal3 = mapPgError(response.error, where);
|
|
4293
4306
|
scream({ code: refusal3.code, message: refusal3.message, ...refusal3.hint ? { hint: refusal3.hint } : {}, where });
|