@protobase/server 0.126.3 → 0.127.1

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/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.126.3";
2
+ var version = "0.127.1";
3
3
  //#endregion
4
4
  export { version };
@@ -12,10 +12,14 @@ const statementTimeoutSlug = "statement-timeout";
12
12
  /** SQLSTATE 57014: Postgres stopped a statement at its `statement_timeout`. */
13
13
  const isStatementTimeout = (error) => error instanceof Error && error.code === "57014";
14
14
  const seconds = (ms) => `${ms / 1e3} s`;
15
+ /** Postgres counts a lock wait toward the timeout, so a fast query stuck behind another transaction is stopped too. */
16
+ const lockWait = "It may also have waited on a lock another transaction held, such as a migration while a deploy runs.";
15
17
  /** What ran too long (`subject`, such as `GET /api/v1/tasks`), the limit, and the ways out. */
16
18
  const statementTimeoutDetail = (subject, limit) => {
17
- if (limit.kind === "long") return `${subject} ran a query longer than ${seconds(longQueryTimeoutMs)}, the most a query may run, so the database stopped it. Make the query faster, or split the work into smaller steps, such as a job per batch.`;
18
- return `${subject} ran a query longer than ${limit.kind === "request" ? seconds(limit.ms) : "the database's statement timeout"}, so the database stopped it. Make the query faster, such as with an index or a narrower filter, or ${limit.kind === "request" ? "move the work into a function or job with longQueries: true" : "give it longQueries: true"}, whose queries may run up to ${seconds(longQueryTimeoutMs)}.`;
19
+ if (limit.kind === "long") return `${subject} ran a query longer than ${seconds(longQueryTimeoutMs)}, the most a query may run, so the database stopped it. ${lockWait} Make the query faster, or split the work into smaller steps, such as a job per batch.`;
20
+ const over = limit.kind === "request" ? seconds(limit.ms) : "the database's statement timeout";
21
+ const longer = limit.kind === "request" ? "move the work into a function or job with longQueries: true" : "give it longQueries: true";
22
+ return `${subject} ran a query longer than ${over}, so the database stopped it. ${lockWait} Make the query faster, such as with an index or a narrower filter, or ${longer}, whose queries may run up to ${seconds(longQueryTimeoutMs)}.`;
19
23
  };
20
24
  /** The 504 of a query Postgres stopped, whose detail already names what ran too long. */
21
25
  var StatementTimeout = class extends HttpProblem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/server",
3
- "version": "0.126.3",
3
+ "version": "0.127.1",
4
4
  "description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -44,11 +44,11 @@
44
44
  "@better-auth/sso": "^1.7.12",
45
45
  "@livekit/protocol": "1.53.1",
46
46
  "@modelcontextprotocol/server": "^2.3.1",
47
- "@protobase/layout": "0.126.3",
48
- "@protobase/query": "0.126.3",
49
- "@protobase/schema": "0.126.3",
50
- "@protobase/workflow-plugins": "0.126.3",
51
- "@protobase/workflows": "0.126.3",
47
+ "@protobase/layout": "0.127.1",
48
+ "@protobase/query": "0.127.1",
49
+ "@protobase/schema": "0.127.1",
50
+ "@protobase/workflow-plugins": "0.127.1",
51
+ "@protobase/workflows": "0.127.1",
52
52
  "@react-email/render": "^2.1.0",
53
53
  "@react-pdf/primitives": "^4.4.0",
54
54
  "@react-pdf/renderer": "^4.9.0",