akanjs 3.3.0-rc.14 → 3.3.0-rc.15

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 CHANGED
@@ -382,6 +382,7 @@
382
382
 
383
383
  The port now answers from the start of the build. A request to `localhost` or an IP address, page or API, waits for the first artifact; a build longer than the 15 s the gateway holds a request ends the wait with a 503 "Backend is starting" page that reloads itself. A request to one of the app's own domains (a custom local domain) gets that 503 at once until the backend is ready, because the build has not written the app's hosts yet; after that it is served as before, and any other Host is refused as before.
384
384
 
385
+ - 05ef91f: The database statement metrics no longer freeze the server at 100% CPU. One statement sent by a seventeenth endpoint when no untraced call had sent it before, or a ninth text of one query shape in local dev's plan check, made the counter call itself with the same arguments forever, with no error or log. Senders past sixteen are counted in one `other` slot and texts past eight share one plan, as intended.
385
386
  - 8f9d432: A page no longer shows a broken character where React's output buffer ends. React writes a page's HTML in 4 KB pieces cut by bytes; when the piece that carried the document's head ended inside a character of more than one byte (Korean, Japanese, an accented letter, an emoji), that character arrived as replacement marks and a stray one closed the document. It depended on where the text fell, so the same page could be right on one request and wrong on the next.
386
387
 
387
388
  ## 3.2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "3.3.0-rc.14",
3
+ "version": "3.3.0-rc.15",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -113,7 +113,7 @@ export class StatementStat {
113
113
  planOf(variant: string): PlanState {
114
114
  let plan = this.#plans.get(variant);
115
115
  if (!plan) {
116
- if (this.#plans.size >= MAX_PLAN_VARIANTS) return this.planOf("");
116
+ if (this.#plans.size >= MAX_PLAN_VARIANTS && variant !== "") return this.planOf("");
117
117
  plan = { epoch: -1, pending: false, dueAt: 0 };
118
118
  this.#plans.set(variant, plan);
119
119
  }
@@ -150,20 +150,18 @@ export class StatementStat {
150
150
  }
151
151
 
152
152
  #senderOf(type: string, key: string): Sender {
153
+ const known = this.#senders.get(type)?.get(key);
154
+ if (known) return known;
155
+ const overflow = type === "" && key === OVERFLOW_LABEL_VALUE;
156
+ if (this.#senderCount >= MAX_SENDERS && !overflow) return this.#senderOf("", OVERFLOW_LABEL_VALUE);
153
157
  let byKey = this.#senders.get(type);
154
158
  if (!byKey) {
155
- if (this.#senderCount >= MAX_SENDERS) return this.#senderOf("", OVERFLOW_LABEL_VALUE);
156
159
  byKey = new Map();
157
160
  this.#senders.set(type, byKey);
158
161
  }
159
- let sender = byKey.get(key);
160
- if (!sender) {
161
- if (this.#senderCount >= MAX_SENDERS && key !== OVERFLOW_LABEL_VALUE)
162
- return this.#senderOf("", OVERFLOW_LABEL_VALUE);
163
- sender = { count: 0, totalMs: 0 };
164
- byKey.set(key, sender);
165
- this.#senderCount += 1;
166
- }
162
+ const sender = { count: 0, totalMs: 0 };
163
+ byKey.set(key, sender);
164
+ this.#senderCount += 1;
167
165
  return sender;
168
166
  }
169
167