@ai-matrx/meet 0.7.8 → 0.7.9
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 +14 -0
- package/dist/index.cjs +21 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21 -11
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +21 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +21 -11
- package/dist/react.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog — `@ai-matrx/meet`
|
|
2
2
|
|
|
3
|
+
## 0.7.9
|
|
4
|
+
### (next patch)
|
|
5
|
+
|
|
6
|
+
- **Fix — a database refusal reads as a sentence for a person** (verifier, 2026-09-27, the
|
|
7
|
+
class behind raw toast text): `normalizeMeetError`'s `message` was
|
|
8
|
+
"meet.x: denied by the database (42501: …)" with a remedy about RLS and service-role
|
|
9
|
+
clients, and hosts render `message` + `remedy` in toasts. Now our RPC's own sentence
|
|
10
|
+
(`RAISE EXCEPTION 'Only the host …'`) is the message; Postgres wording, SQLSTATEs and class
|
|
11
|
+
names become a plain sentence ("You don't have access to do that in this meeting.", "This
|
|
12
|
+
meeting changed a moment ago…", "The server could not be reached."); the raw error stays on
|
|
13
|
+
`cause`. `SERVER_FAILED_SENTENCE` / `isRawServerText` now live in `core/errors.ts`
|
|
14
|
+
(still re-exported from the root).
|
|
15
|
+
- **Consumer action:** none.
|
|
16
|
+
|
|
3
17
|
## 0.7.8
|
|
4
18
|
### (next patch)
|
|
5
19
|
|
package/dist/index.cjs
CHANGED
|
@@ -220,6 +220,20 @@ var MeetError = class extends Error {
|
|
|
220
220
|
return this.code === "permission-denied" || this.code === "device-not-found" || this.code === "device-in-use" || this.code === "insecure-context";
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
|
+
var SERVER_FAILED_SENTENCE = "The server hit an unexpected problem and nothing was changed.";
|
|
224
|
+
function isRawServerText(value) {
|
|
225
|
+
const text3 = value.trim();
|
|
226
|
+
return /^internal server error\b/i.test(text3) || /^[A-Z][A-Za-z0-9]*(Error|Exception)$/.test(text3) || /^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(text3);
|
|
227
|
+
}
|
|
228
|
+
function humanDatabaseSentence(message) {
|
|
229
|
+
const text3 = message.trim();
|
|
230
|
+
if (text3.length === 0 || isRawServerText(text3)) return null;
|
|
231
|
+
if (/permission denied for|violates|relation "|does not exist|syntax error|column "|jwt|pgrst|duplicate key|null value in/i.test(
|
|
232
|
+
text3
|
|
233
|
+
))
|
|
234
|
+
return null;
|
|
235
|
+
return text3;
|
|
236
|
+
}
|
|
223
237
|
var FORBIDDEN_CODES = /* @__PURE__ */ new Set(["42501", "PGRST301", "PGRST302"]);
|
|
224
238
|
var NOT_FOUND_CODES = /* @__PURE__ */ new Set(["PGRST116", "PGRST205"]);
|
|
225
239
|
var CONFLICT_CODES = /* @__PURE__ */ new Set(["23505", "40001", "55000"]);
|
|
@@ -247,8 +261,8 @@ function normalizeMeetError(error, operation) {
|
|
|
247
261
|
if (code !== void 0 && FORBIDDEN_CODES.has(code)) {
|
|
248
262
|
return new MeetError(
|
|
249
263
|
"forbidden",
|
|
250
|
-
|
|
251
|
-
"
|
|
264
|
+
humanDatabaseSentence(message) ?? "You don't have access to do that in this meeting.",
|
|
265
|
+
"Ask the meeting's host to do it, or to give you access.",
|
|
252
266
|
error
|
|
253
267
|
);
|
|
254
268
|
}
|
|
@@ -263,15 +277,16 @@ function normalizeMeetError(error, operation) {
|
|
|
263
277
|
if (code !== void 0 && CONFLICT_CODES.has(code)) {
|
|
264
278
|
return new MeetError(
|
|
265
279
|
"conflict",
|
|
266
|
-
|
|
267
|
-
"
|
|
280
|
+
humanDatabaseSentence(message) ?? "This meeting changed a moment ago, so nothing was saved.",
|
|
281
|
+
"Reload to see the latest, then try again.",
|
|
268
282
|
error
|
|
269
283
|
);
|
|
270
284
|
}
|
|
285
|
+
const hint = error?.hint;
|
|
271
286
|
return new MeetError(
|
|
272
287
|
"transport",
|
|
273
|
-
|
|
274
|
-
|
|
288
|
+
/failed to fetch|networkerror|load failed|network request failed/i.test(message) ? "The server could not be reached." : humanDatabaseSentence(message) ?? SERVER_FAILED_SENTENCE,
|
|
289
|
+
typeof hint === "string" && humanDatabaseSentence(hint) !== null ? hint.trim() : "Nothing was changed \u2014 retry in a moment; if it keeps happening, reload the page.",
|
|
275
290
|
error
|
|
276
291
|
);
|
|
277
292
|
}
|
|
@@ -679,11 +694,6 @@ function readText(data) {
|
|
|
679
694
|
}
|
|
680
695
|
return "";
|
|
681
696
|
}
|
|
682
|
-
var SERVER_FAILED_SENTENCE = "The server hit an unexpected problem and nothing was changed.";
|
|
683
|
-
function isRawServerText(value) {
|
|
684
|
-
const text3 = value.trim();
|
|
685
|
-
return /^internal server error\b/i.test(text3) || /^[A-Z][A-Za-z0-9]*(Error|Exception)$/.test(text3) || /^[a-z][a-z0-9]*(_[a-z0-9]+)+$/.test(text3);
|
|
686
|
-
}
|
|
687
697
|
async function refusalFromResponse(response, operation, fallbackRemedy) {
|
|
688
698
|
let body = null;
|
|
689
699
|
try {
|