@civitai/blocks-react 0.52.0 → 0.53.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/README.md CHANGED
@@ -35,7 +35,9 @@ export function App() {
35
35
  const rootRef = useRef<HTMLDivElement>(null);
36
36
  useBlockResize(rootRef); // host fits the iframe to content
37
37
 
38
- if (!ready) return <div ref={rootRef}>Loading…</div>;
38
+ // No ref on the pre-init skeleton — useBlockResize observes the real root
39
+ // whenever it mounts, including on a later render.
40
+ if (!ready) return <div>Loading…</div>;
39
41
  // `context` is a union keyed on slotId — narrow with the guard, not a cast.
40
42
  if (!isModelSlotContext(context)) return <div ref={rootRef}>Wrong slot.</div>;
41
43
 
@@ -153,6 +155,12 @@ const rootRef = useRef<HTMLDivElement>(null);
153
155
  useBlockResize(rootRef);
154
156
  ```
155
157
 
158
+ **The element may mount on a later render, and that is the normal case** — a
159
+ block renders a skeleton until `BLOCK_INIT` lands. The hook keys on the observed
160
+ *element*, so you do **not** need to pin the same `ref` to every branch of a
161
+ loading/ready conditional to keep the host resizing. Put it on the root you
162
+ actually want measured, in whichever branch renders it.
163
+
156
164
  > Also set `iframe.minHeight` in your manifest to the block's *real* rendered
157
165
  > height — a too-small minHeight makes the iframe seed short and grow-jump on
158
166
  > `BLOCK_READY` (CLS). Measure it in the dev harness (gotcha #53).
@@ -1039,7 +1047,7 @@ import {
1039
1047
  export function App() {
1040
1048
  const { ready, theme } = useBlockContext();
1041
1049
  const rootRef = useRef<HTMLDivElement>(null);
1042
- if (!ready) return <div ref={rootRef}>Loading…</div>;
1050
+ if (!ready) return <div>Loading…</div>;
1043
1051
 
1044
1052
  return (
1045
1053
  // GOTCHA #60 — theme your OWN root; that's what the pack reads.
@@ -9,11 +9,37 @@ import { type RefObject } from 'react';
9
9
  * - Inline path: `InlineTransport.sendMessage` is a no-op (the host DOM
10
10
  * reflows naturally), so the observer fires but no message goes out.
11
11
  *
12
+ * 🔴 THE ELEMENT MAY MOUNT ON A LATER RENDER, AND THAT IS THE NORMAL CASE.
13
+ * Every block renders a skeleton until `BLOCK_INIT` lands, so on the first
14
+ * render there is nothing to observe. This hook therefore keys on the OBSERVED
15
+ * ELEMENT, not on the ref wrapper's identity — the same reasoning written down
16
+ * at `useBlockBreakpoint.ts`'s effect, with one mechanical difference that
17
+ * matters:
18
+ *
19
+ * `useBlockBreakpoint` can compare `ref.current` read DURING RENDER, because
20
+ * it re-renders its own caller and so always gets another render in which to
21
+ * notice. This hook re-renders nobody. React attaches a ref during COMMIT,
22
+ * i.e. AFTER the render that mounts it, so a `[ref.current]` dependency read
23
+ * during render is a render behind and — with no further render coming —
24
+ * never catches up. Measured: with `[ref.current]` as the dependency, a
25
+ * component that mounts its root on the second render still observes
26
+ * nothing.
27
+ *
28
+ * So the effect runs on every render (no dependency array) and does its own
29
+ * identity check against the element it is already observing. The check is a
30
+ * reference compare; the observer is torn down and rebuilt only when the
31
+ * element actually changes.
32
+ *
33
+ * Because of this, a block does NOT need to pin the same `ref` to every branch
34
+ * of a loading/ready conditional to keep the host resizing. That workaround was
35
+ * load-bearing before this fix and is not any more.
36
+ *
12
37
  * @param ref - Ref to the block's root DOM element to observe.
13
38
  *
14
39
  * @example
15
40
  * const rootRef = useRef<HTMLDivElement>(null);
16
41
  * useBlockResize(rootRef); // host fits the iframe to content
42
+ * if (!ready) return <div>Loading…</div>; // no ref needed on this branch
17
43
  * return <div ref={rootRef}>…</div>;
18
44
  */
19
45
  export declare function useBlockResize(ref: RefObject<HTMLElement | null>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockResize.d.ts","sourceRoot":"","sources":["../../src/hooks/useBlockResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAiBvE"}
1
+ {"version":3,"file":"useBlockResize.d.ts","sourceRoot":"","sources":["../../src/hooks/useBlockResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAyCvE"}
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { useEffect, useRef } from 'react';
2
2
  import { getTransport } from '../internal/singleton.js';
3
3
  /**
4
4
  * Observes the referenced element's height and asks the host to resize on
@@ -10,20 +10,67 @@ import { getTransport } from '../internal/singleton.js';
10
10
  * - Inline path: `InlineTransport.sendMessage` is a no-op (the host DOM
11
11
  * reflows naturally), so the observer fires but no message goes out.
12
12
  *
13
+ * 🔴 THE ELEMENT MAY MOUNT ON A LATER RENDER, AND THAT IS THE NORMAL CASE.
14
+ * Every block renders a skeleton until `BLOCK_INIT` lands, so on the first
15
+ * render there is nothing to observe. This hook therefore keys on the OBSERVED
16
+ * ELEMENT, not on the ref wrapper's identity — the same reasoning written down
17
+ * at `useBlockBreakpoint.ts`'s effect, with one mechanical difference that
18
+ * matters:
19
+ *
20
+ * `useBlockBreakpoint` can compare `ref.current` read DURING RENDER, because
21
+ * it re-renders its own caller and so always gets another render in which to
22
+ * notice. This hook re-renders nobody. React attaches a ref during COMMIT,
23
+ * i.e. AFTER the render that mounts it, so a `[ref.current]` dependency read
24
+ * during render is a render behind and — with no further render coming —
25
+ * never catches up. Measured: with `[ref.current]` as the dependency, a
26
+ * component that mounts its root on the second render still observes
27
+ * nothing.
28
+ *
29
+ * So the effect runs on every render (no dependency array) and does its own
30
+ * identity check against the element it is already observing. The check is a
31
+ * reference compare; the observer is torn down and rebuilt only when the
32
+ * element actually changes.
33
+ *
34
+ * Because of this, a block does NOT need to pin the same `ref` to every branch
35
+ * of a loading/ready conditional to keep the host resizing. That workaround was
36
+ * load-bearing before this fix and is not any more.
37
+ *
13
38
  * @param ref - Ref to the block's root DOM element to observe.
14
39
  *
15
40
  * @example
16
41
  * const rootRef = useRef<HTMLDivElement>(null);
17
42
  * useBlockResize(rootRef); // host fits the iframe to content
43
+ * if (!ready) return <div>Loading…</div>; // no ref needed on this branch
18
44
  * return <div ref={rootRef}>…</div>;
19
45
  */
20
46
  export function useBlockResize(ref) {
47
+ /** The element the live observer is watching. `null` = watching nothing. */
48
+ const observedRef = useRef(null);
49
+ const observerRef = useRef(null);
50
+ // Unmount-only teardown. Declared FIRST so that on a remount (React
51
+ // StrictMode's deliberate double-invoke) its cleanup — which clears
52
+ // `observedRef` — runs before the observe effect's setup re-runs and finds a
53
+ // clean slate. React runs every cleanup before any setup.
54
+ useEffect(() => {
55
+ return () => {
56
+ observerRef.current?.disconnect();
57
+ observerRef.current = null;
58
+ observedRef.current = null;
59
+ };
60
+ }, []);
61
+ // No dependency array on purpose — see the block comment above. The identity
62
+ // check below, not a dependency list, is what makes this cheap.
21
63
  useEffect(() => {
64
+ if (typeof ResizeObserver === 'undefined')
65
+ return;
22
66
  const el = ref.current;
67
+ if (el === observedRef.current)
68
+ return; // already observing exactly this
69
+ observerRef.current?.disconnect();
70
+ observerRef.current = null;
71
+ observedRef.current = el;
23
72
  if (!el)
24
73
  return;
25
- if (typeof ResizeObserver === 'undefined')
26
- return;
27
74
  const transport = getTransport();
28
75
  let lastHeight = -1;
29
76
  const observer = new ResizeObserver((entries) => {
@@ -34,7 +81,7 @@ export function useBlockResize(ref) {
34
81
  transport.sendMessage({ type: 'RESIZE_IFRAME', payload: { height } });
35
82
  });
36
83
  observer.observe(el);
37
- return () => observer.disconnect();
38
- }, [ref]);
84
+ observerRef.current = observer;
85
+ });
39
86
  }
40
87
  //# sourceMappingURL=useBlockResize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBlockResize.js","sourceRoot":"","sources":["../../src/hooks/useBlock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C,UAAU,GAAG,MAAM,CAAC;YACpB,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -101,6 +101,103 @@ export declare class IframeTransport implements BlockTransport {
101
101
  dispose(): void;
102
102
  private dispatch;
103
103
  private flushOutbound;
104
+ /**
105
+ * Which block→host request a reply we are about to drop leaves hanging, and
106
+ * whether we can tell at all.
107
+ *
108
+ * 🔴 "NO REQUEST IS PENDING" AND "I CANNOT TELL WHICH" ARE DIFFERENT ANSWERS, and
109
+ * an earlier revision collapsed them. It returned `'other'` whenever `requestId`
110
+ * was not a readable string and the `console.warn` then asserted *"unsolicited
111
+ * push — nothing was awaiting it"*, which is FALSE for two shapes that occur:
112
+ * - a reply whose whole payload is not an object (`isObject` is the first thing
113
+ * most validators check), while its request sits in `pending` and hangs to its
114
+ * timeout;
115
+ * - a PRE-v2 host, which echoes `requestId` only via
116
+ * `...(requestId ? { requestId } : {})` — the asymmetry
117
+ * `isValidTokenRefreshResponse` exists to tolerate (NOT `isValidTokenRefresh`,
118
+ * which validates a host PUSH and has no `requestId` handling at all), so a
119
+ * legacy host's malformed `TOKEN_REFRESH_RESPONSE`
120
+ * arrives with no `requestId` at all while `REQUEST_TOKEN` is awaiting it.
121
+ * In both, something IS hanging and the operator was told the opposite. So a
122
+ * reply that leaves a request OF ITS OWN TYPE unattributed reports `unknown`
123
+ * rather than `pushed`, and the warn names how many are awaiting that reply type
124
+ * rather than claiming none was.
125
+ *
126
+ * 🔴 AND THE LOOKUP APPLIES THE SAME `responseType` PREDICATE AS REAL
127
+ * CORRELATION. Without it, a malformed reply carrying ANOTHER in-flight request's
128
+ * `requestId` — which a buggy host can produce by echoing the wrong id — reports
129
+ * against the wrong request type, i.e. mislabels a healthy request as the broken
130
+ * one. `handleMessage` already refuses to settle such a reply; this must refuse to
131
+ * name it for the same reason.
132
+ *
133
+ * The `requestId` is read from an UNVALIDATED payload (the validator just
134
+ * rejected it), so it is used ONLY as a `Map` key on our own pending table and
135
+ * never trusted as data.
136
+ *
137
+ * 🔴 THE CLAMP IS NOT REDUNDANT WITH THE TYPE SYSTEM. `requestType` is whatever
138
+ * the caller passed to `sendRequest` — typed, but a JavaScript consumer, or a
139
+ * block built against a newer protocol, can put any string there, and this value
140
+ * becomes a Prometheus label on the host. See `boundBlockToParentMessageType`.
141
+ */
142
+ private hangingRequestTypeFor;
143
+ /**
144
+ * Tell the host that this transport refused an inbound message, so the drop
145
+ * becomes a number instead of a `console.warn` nobody is reading.
146
+ *
147
+ * 🔴 WHY IT GOES OVER THE BRIDGE AND NOT STRAIGHT TO AN ENDPOINT. A block runs
148
+ * in a sandboxed iframe at an OPAQUE origin with no ambient credential and no
149
+ * civitai session, so it has no metrics path of its own: a direct POST would be
150
+ * cross-origin, uncredentialed, and would need a new PUBLIC unauthenticated
151
+ * endpoint to receive it — a fresh abuse surface for an observability add-on, and
152
+ * explicitly out of scope. The host already owns the receiving half: its
153
+ * dispatcher counts every inbound bridge message on
154
+ * `civitai_app_block_bridge_messages_total{app_block_id,type,host,outcome}` and
155
+ * flushes it through the same-origin, coalescing `/api/track/block-message`
156
+ * beacon. Reporting over the bridge reuses that end to end and adds no route: the
157
+ * host's handler for this message records `outcome="validator_rejected"` against
158
+ * the `type` we name here.
159
+ *
160
+ * 🔴 THE VALIDATOR'S NAME IS NOT ON THIS WIRE, AND THE `console.warn` DOES NOT
161
+ * CLOSE THE GAP EITHER — an earlier revision of this docblock claimed it did, and
162
+ * that was false. `payloadValidatorFor` is a function from type to validator, so
163
+ * the TOP-LEVEL validator is derivable from the type already on the wire; a
164
+ * `validator` field would carry only that derivable half, which reads as coverage
165
+ * while adding none, and a fifth Prometheus label is not free (the beacon route's
166
+ * own docblock asks for the label product to be read before one is added). The
167
+ * half that is NOT derivable is which NESTED helper rejected —
168
+ * `isValidGatedImage` inside `isValidImagesResult` on 2026-09-18 — and the warn
169
+ * cannot supply it: `validator.name` resolves to the top-level validator, and no
170
+ * helper in `validate.ts` reports its own name anywhere at runtime. So that
171
+ * diagnosis is UNAVAILABLE today, from any surface. Closing it means teaching the
172
+ * validators to return a reason; do not read the warn as a substitute.
173
+ *
174
+ * 🔴 NOTHING IS REPORTED BEFORE `BLOCK_INIT`, DELIBERATELY. `dispatch` has no
175
+ * `parentOrigin` until the first valid init, so a report raised while rejecting a
176
+ * malformed `BLOCK_INIT` could only be QUEUED — and the host re-sends init on a
177
+ * ~400ms interval until `BLOCK_READY`, so that queue is a producer with no
178
+ * consumer: ~25 entries inside one 10s ready window, flushed only if a later init
179
+ * succeeds and silently discarded if none does. The gap it would have covered is
180
+ * already covered by a different series — a block that never inits never sends
181
+ * `BLOCK_READY`, so the host's ready timeout records
182
+ * `civitai_app_block_renders_total{result="timeout"}`. This counter exists for the
183
+ * failures AFTER ready, which that one is structurally blind to.
184
+ *
185
+ * 🔴 NO EMIT BUDGET, AND THE ONE AN EARLIER REVISION CARRIED WAS JUSTIFIED BY A
186
+ * FALSEHOOD. It capped reports at 30 per 10s "so a flood cannot burn the host's
187
+ * 30 msg/sec inbound budget that legitimate `BLOCK_ERROR` reporting needs". The
188
+ * host consumes `BLOCK_MESSAGE_REJECTED` in its shared dispatcher ABOVE that
189
+ * limiter — the same placement, and for the same stated reason, as its
190
+ * `no_handler` branch — so a report consumes none of that budget and the cap
191
+ * bought nothing. What it did buy was a permanent UNDERCOUNT, which inverts the
192
+ * receiving side's own documented preference: `bridgeLabels.ts` chooses its clamp
193
+ * so that "a real flood is still VISIBLE rather than exactly counted … the series
194
+ * reads 'enormous' instead of 'wrong'". A cap here makes a flood read SMALL, the
195
+ * one shape of wrongness that side rejects. Magnitude is therefore unbounded on
196
+ * this path exactly as it already is for `no_handler` and `deduped`; the host's
197
+ * `BRIDGE_MESSAGE_COUNT_MAX` is the clamp that bounds a row, and the beacon
198
+ * coalesces identical label sets, so the network cost of a flood is ~one row.
199
+ */
200
+ private reportRejection;
104
201
  private postToParent;
105
202
  private handleMessage;
106
203
  private applyTokenRefresh;
@@ -1 +1 @@
1
- {"version":3,"file":"iframeTransport.d.ts","sourceRoot":"","sources":["../../src/internal/iframeTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAEzB,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AASxB,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AASD;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,cAAc;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAoB;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,yEAAyE;IACzE,OAAO,CAAC,YAAY,CAAuB;IAE3C,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiD;IAC1E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAE7D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsD;IAEpF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,OAAO,CAAC,WAAW,CAAuC;IAC1D,OAAO,CAAC,UAAU,CAAwB;IAC1C,OAAO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IAIxC,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAIhD,WAAW,CACT,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,wBAAwB,EACtC,IAAI,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAChC,OAAO,CAAC,OAAO,CAAC;IAuBnB,SAAS,CACP,IAAI,EAAE,wBAAwB,EAC9B,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAClC,MAAM,IAAI;IAeb,uDAAuD;IACvD,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,aAAa;IAOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,OAAO,CAAC,qBAAqB;IAmD7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;IACH,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,aAAa;IA4IrB,OAAO,CAAC,iBAAiB;IASzB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,IAAI;CAGb"}
@@ -1,4 +1,4 @@
1
- import { isMessage, parseBlockInitFragment, stripBlockInitFragment, } from '@civitai/app-sdk/blocks';
1
+ import { boundBlockToParentMessageType, isMessage, OTHER_MESSAGE_TYPE_LABEL, parseBlockInitFragment, stripBlockInitFragment, } from '@civitai/app-sdk/blocks';
2
2
  import { EMPTY_SNAPSHOT, nextRequestId, RequestTimeoutError, snapshotFromInit, tokenFromWrapped, } from './transport.js';
3
3
  import { OriginMatcher } from './originMatcher.js';
4
4
  import { DEFAULT_REQUEST_TIMEOUT_MS } from './requestTimeouts.js';
@@ -223,6 +223,7 @@ export class IframeTransport {
223
223
  reject,
224
224
  timeoutId,
225
225
  responseType,
226
+ requestType: request.type,
226
227
  });
227
228
  this.dispatch(request.type, { ...request.payload, requestId });
228
229
  });
@@ -268,6 +269,164 @@ export class IframeTransport {
268
269
  this.postToParent(msg);
269
270
  }
270
271
  }
272
+ /**
273
+ * Which block→host request a reply we are about to drop leaves hanging, and
274
+ * whether we can tell at all.
275
+ *
276
+ * 🔴 "NO REQUEST IS PENDING" AND "I CANNOT TELL WHICH" ARE DIFFERENT ANSWERS, and
277
+ * an earlier revision collapsed them. It returned `'other'` whenever `requestId`
278
+ * was not a readable string and the `console.warn` then asserted *"unsolicited
279
+ * push — nothing was awaiting it"*, which is FALSE for two shapes that occur:
280
+ * - a reply whose whole payload is not an object (`isObject` is the first thing
281
+ * most validators check), while its request sits in `pending` and hangs to its
282
+ * timeout;
283
+ * - a PRE-v2 host, which echoes `requestId` only via
284
+ * `...(requestId ? { requestId } : {})` — the asymmetry
285
+ * `isValidTokenRefreshResponse` exists to tolerate (NOT `isValidTokenRefresh`,
286
+ * which validates a host PUSH and has no `requestId` handling at all), so a
287
+ * legacy host's malformed `TOKEN_REFRESH_RESPONSE`
288
+ * arrives with no `requestId` at all while `REQUEST_TOKEN` is awaiting it.
289
+ * In both, something IS hanging and the operator was told the opposite. So a
290
+ * reply that leaves a request OF ITS OWN TYPE unattributed reports `unknown`
291
+ * rather than `pushed`, and the warn names how many are awaiting that reply type
292
+ * rather than claiming none was.
293
+ *
294
+ * 🔴 AND THE LOOKUP APPLIES THE SAME `responseType` PREDICATE AS REAL
295
+ * CORRELATION. Without it, a malformed reply carrying ANOTHER in-flight request's
296
+ * `requestId` — which a buggy host can produce by echoing the wrong id — reports
297
+ * against the wrong request type, i.e. mislabels a healthy request as the broken
298
+ * one. `handleMessage` already refuses to settle such a reply; this must refuse to
299
+ * name it for the same reason.
300
+ *
301
+ * The `requestId` is read from an UNVALIDATED payload (the validator just
302
+ * rejected it), so it is used ONLY as a `Map` key on our own pending table and
303
+ * never trusted as data.
304
+ *
305
+ * 🔴 THE CLAMP IS NOT REDUNDANT WITH THE TYPE SYSTEM. `requestType` is whatever
306
+ * the caller passed to `sendRequest` — typed, but a JavaScript consumer, or a
307
+ * block built against a newer protocol, can put any string there, and this value
308
+ * becomes a Prometheus label on the host. See `boundBlockToParentMessageType`.
309
+ */
310
+ hangingRequestTypeFor(replyType, payload) {
311
+ // 🔴 THE DISCRIMINATOR IS "WHO IS AWAITING **THIS REPLY TYPE**", NOT
312
+ // `pending.size`. An earlier revision used the size of the whole table, and it
313
+ // was wrong in BOTH directions — the shape this file keeps producing:
314
+ // - too WIDE: a genuine malformed PUSH (`THEME_CHANGE`, `CONSENT_UNAVAILABLE`,
315
+ // `TOKEN_REFRESH`) arriving while anything at all was in flight printed "one
316
+ // may now hang", when `validate.ts` says in as many words that dropping one
317
+ // of those "costs at most a stale theme … never a hang — nothing awaits this
318
+ // message". For a busy block that made the honest push case near-unreachable;
319
+ // - too NARROW, on the same pass: the `responseType`-mismatch branch reached
320
+ // the "this reply names none of them" wording having just FOUND the request
321
+ // by id, so it asserted the one thing that was demonstrably false there.
322
+ // Filtering by `responseType` answers both: if nobody is awaiting this reply
323
+ // type, nothing here can hang whatever else is in flight.
324
+ //
325
+ // ⚠️ ONE EXCEPTION, AND IT IS THE HIGHEST-STAKES MOMENT THIS WARN HAS.
326
+ // `BLOCK_INIT` has a validator and is never any request's `responseType`, so a
327
+ // malformed one always lands on `pushed` and prints "nothing was awaiting it" —
328
+ // while `waitForInit()` IS awaiting it and rejects 10s later, after which the
329
+ // host shows a fallback.
330
+ //
331
+ // ⚠️ AND THE FILTER DID CHANGE THIS PATH, which an earlier revision of this note
332
+ // denied on the premise that "pre-init `pending` is empty". It is not: a block
333
+ // calling `useViewer()` from a bare mount effect has `GET_VIEWER` in `pending`
334
+ // before any init lands, because `sendRequest` inserts there BEFORE `dispatch`
335
+ // decides to queue. Under the old `pending.size` discriminator that printed
336
+ // "1 request(s) … may now hang"; now it prints the push wording — i.e. the change
337
+ // moved this path in the direction this very note calls the worst one. The
338
+ // CONCLUSION still holds (no metric moves: `reportRejection` returns early on
339
+ // `!parentOrigin`), and the rule above is not universal. Only the premise was
340
+ // wrong.
341
+ const awaiting = [...this.pending.values()].filter((p) => p.responseType === replyType);
342
+ if (awaiting.length === 0) {
343
+ return { label: OTHER_MESSAGE_TYPE_LABEL, hung: 'pushed' };
344
+ }
345
+ const requestId = payload?.requestId;
346
+ if (typeof requestId === 'string') {
347
+ const pending = this.pending.get(requestId);
348
+ // The same predicate `handleMessage` applies before it will SETTLE a reply.
349
+ // An id matching a request awaiting a DIFFERENT reply type names nothing we
350
+ // may attribute: blaming it would pin this breakage on a healthy request.
351
+ if (pending && pending.responseType === replyType) {
352
+ return { label: boundBlockToParentMessageType(pending.requestType), hung: 'named' };
353
+ }
354
+ }
355
+ return { label: OTHER_MESSAGE_TYPE_LABEL, hung: 'unknown', awaiting: awaiting.length };
356
+ }
357
+ /**
358
+ * Tell the host that this transport refused an inbound message, so the drop
359
+ * becomes a number instead of a `console.warn` nobody is reading.
360
+ *
361
+ * 🔴 WHY IT GOES OVER THE BRIDGE AND NOT STRAIGHT TO AN ENDPOINT. A block runs
362
+ * in a sandboxed iframe at an OPAQUE origin with no ambient credential and no
363
+ * civitai session, so it has no metrics path of its own: a direct POST would be
364
+ * cross-origin, uncredentialed, and would need a new PUBLIC unauthenticated
365
+ * endpoint to receive it — a fresh abuse surface for an observability add-on, and
366
+ * explicitly out of scope. The host already owns the receiving half: its
367
+ * dispatcher counts every inbound bridge message on
368
+ * `civitai_app_block_bridge_messages_total{app_block_id,type,host,outcome}` and
369
+ * flushes it through the same-origin, coalescing `/api/track/block-message`
370
+ * beacon. Reporting over the bridge reuses that end to end and adds no route: the
371
+ * host's handler for this message records `outcome="validator_rejected"` against
372
+ * the `type` we name here.
373
+ *
374
+ * 🔴 THE VALIDATOR'S NAME IS NOT ON THIS WIRE, AND THE `console.warn` DOES NOT
375
+ * CLOSE THE GAP EITHER — an earlier revision of this docblock claimed it did, and
376
+ * that was false. `payloadValidatorFor` is a function from type to validator, so
377
+ * the TOP-LEVEL validator is derivable from the type already on the wire; a
378
+ * `validator` field would carry only that derivable half, which reads as coverage
379
+ * while adding none, and a fifth Prometheus label is not free (the beacon route's
380
+ * own docblock asks for the label product to be read before one is added). The
381
+ * half that is NOT derivable is which NESTED helper rejected —
382
+ * `isValidGatedImage` inside `isValidImagesResult` on 2026-09-18 — and the warn
383
+ * cannot supply it: `validator.name` resolves to the top-level validator, and no
384
+ * helper in `validate.ts` reports its own name anywhere at runtime. So that
385
+ * diagnosis is UNAVAILABLE today, from any surface. Closing it means teaching the
386
+ * validators to return a reason; do not read the warn as a substitute.
387
+ *
388
+ * 🔴 NOTHING IS REPORTED BEFORE `BLOCK_INIT`, DELIBERATELY. `dispatch` has no
389
+ * `parentOrigin` until the first valid init, so a report raised while rejecting a
390
+ * malformed `BLOCK_INIT` could only be QUEUED — and the host re-sends init on a
391
+ * ~400ms interval until `BLOCK_READY`, so that queue is a producer with no
392
+ * consumer: ~25 entries inside one 10s ready window, flushed only if a later init
393
+ * succeeds and silently discarded if none does. The gap it would have covered is
394
+ * already covered by a different series — a block that never inits never sends
395
+ * `BLOCK_READY`, so the host's ready timeout records
396
+ * `civitai_app_block_renders_total{result="timeout"}`. This counter exists for the
397
+ * failures AFTER ready, which that one is structurally blind to.
398
+ *
399
+ * 🔴 NO EMIT BUDGET, AND THE ONE AN EARLIER REVISION CARRIED WAS JUSTIFIED BY A
400
+ * FALSEHOOD. It capped reports at 30 per 10s "so a flood cannot burn the host's
401
+ * 30 msg/sec inbound budget that legitimate `BLOCK_ERROR` reporting needs". The
402
+ * host consumes `BLOCK_MESSAGE_REJECTED` in its shared dispatcher ABOVE that
403
+ * limiter — the same placement, and for the same stated reason, as its
404
+ * `no_handler` branch — so a report consumes none of that budget and the cap
405
+ * bought nothing. What it did buy was a permanent UNDERCOUNT, which inverts the
406
+ * receiving side's own documented preference: `bridgeLabels.ts` chooses its clamp
407
+ * so that "a real flood is still VISIBLE rather than exactly counted … the series
408
+ * reads 'enormous' instead of 'wrong'". A cap here makes a flood read SMALL, the
409
+ * one shape of wrongness that side rejects. Magnitude is therefore unbounded on
410
+ * this path exactly as it already is for `no_handler` and `deduped`; the host's
411
+ * `BRIDGE_MESSAGE_COUNT_MAX` is the clamp that bounds a row, and the beacon
412
+ * coalesces identical label sets, so the network cost of a flood is ~one row.
413
+ */
414
+ reportRejection(hangingRequestType) {
415
+ // No parent origin yet ⇒ nothing to post to, and queueing is worse than
416
+ // dropping here (see the docblock). Checked rather than left to `dispatch`,
417
+ // whose queue is unbounded and has no consumer on this path.
418
+ if (!this.parentOrigin)
419
+ return;
420
+ // Fail-soft: a throw here would propagate out of the `message` listener and
421
+ // abort dispatch for this event — turning an observability feature into a
422
+ // second silent drop on top of the one it is reporting.
423
+ try {
424
+ this.dispatch('BLOCK_MESSAGE_REJECTED', { type: hangingRequestType });
425
+ }
426
+ catch {
427
+ // swallow — telemetry must never break the transport it observes
428
+ }
429
+ }
271
430
  postToParent(msg) {
272
431
  // `parentOrigin` is captured from a validated BLOCK_INIT; safe to use as targetOrigin.
273
432
  this.window.parent.postMessage(msg, this.parentOrigin);
@@ -284,8 +443,25 @@ export class IframeTransport {
284
443
  // rather than crash — see ./validate.ts.
285
444
  const validator = payloadValidatorFor(data.type);
286
445
  if (validator && !validator(data.payload)) {
446
+ const hanging = this.hangingRequestTypeFor(data.type, data.payload);
447
+ // 🔴 THE THREE CASES SAY THREE DIFFERENT THINGS, and `unknown` is the one an
448
+ // earlier revision printed as `pushed`. Claiming "nothing was awaiting it"
449
+ // while a request hangs is worse than saying nothing: it sends the one person
450
+ // reading this console away from the actual symptom.
451
+ const diagnosis = hanging.hung === 'named'
452
+ ? `; "${hanging.label}" will now hang to its request timeout)`
453
+ : hanging.hung === 'pushed'
454
+ ? ', unsolicited push — nothing was awaiting it)'
455
+ // `hung` is exactly three states and the two above are excluded, so this
456
+ // arm is `'unknown'` by construction — but a FOURTH state would land here
457
+ // silently, and the obvious `: 0` fallback prints "0 request(s) … so one
458
+ // may now hang", a sentence that contradicts itself. Say that instead.
459
+ : `; ${hanging.hung === 'unknown' ? `${hanging.awaiting} request(s)` : 'an unknown number of requests'} awaiting "${data.type}" and this reply names none of them, so one may now hang)`;
287
460
  // eslint-disable-next-line no-console -- developer-facing diagnostic at a trust boundary
288
- console.warn(`IframeTransport: dropping malformed "${data.type}" message from ${event.origin}`);
461
+ console.warn(`IframeTransport: dropping malformed "${data.type}" message from ${event.origin} ` +
462
+ `(rejected by ${validator.name || 'an anonymous validator'}` +
463
+ diagnosis);
464
+ this.reportRejection(hanging.label);
289
465
  return;
290
466
  }
291
467
  // CONTRACT — load-bearing, do NOT weaken the `!this.initResolved` guard:
@@ -1 +1 @@
1
- {"version":3,"file":"iframeTransport.js","sourceRoot":"","sources":["../../src/internal/iframeTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,sBAAsB,GAKvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD,MAAM,eAAe,GAAG,MAAM,CAAC;AAuB/B;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IACT,aAAa,CAAgB;IAC9C;;;;;OAKG;IACc,mBAAmB,CAAoB;IACvC,MAAM,CAAS;IAExB,QAAQ,GAAkB,cAAc,CAAC;IAChC,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAEnD,yEAAyE;IACjE,YAAY,GAAkB,IAAI,CAAC;IAE3C,2EAA2E;IAC1D,QAAQ,GAA8C,EAAE,CAAC;IACzD,OAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE7D;;;;OAIG;IACc,aAAa,GAA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AAmB;AAC7B,gFAAgF;AAC9E,OAAO;AACT,uFAAuF;GACrF,UAAU;AACZ,qFAAqF;GACnF,UAAU,CAAC;AA4Jf;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,wBAAwB,EAIhE,CAAC"}
1
+ {"version":3,"file":"requestTimeouts.d.ts","sourceRoot":"","sources":["../../src/internal/requestTimeouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAIxE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,4BAA4B,QAAc,CAAC;AAExD,4DAA4D;AAC5D,MAAM,MAAM,mBAAmB;AAC7B,gFAAgF;AAC9E,OAAO;AACT,uFAAuF;GACrF,UAAU;AACZ,qFAAqF;GACnF,UAAU,CAAC;AAqKf;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,wBAAwB,EAIhE,CAAC"}
@@ -72,6 +72,15 @@ const REQUEST_TIMEOUT_CLASS = {
72
72
  // ── Fire-and-forget: no requestId, so no pending promise to time out ────
73
73
  BLOCK_ERROR: 'no-reply',
74
74
  BLOCK_HELLO: 'no-reply',
75
+ // Reports a drop that has ALREADY happened, so there is nothing to answer and
76
+ // nothing to bound. Deliberately `'no-reply'` and not merely "unhandled": if a
77
+ // host ever did reply to it, that reply would itself run the validator this
78
+ // message exists to report on — a rejection loop with NOTHING braking it. (The
79
+ // emitter carries no cap; an earlier revision did, and this comment used to name
80
+ // it as the brake.) The loop is unreachable today because the payload carries no
81
+ // `requestId`, so neither host NACKs it — but that is a property of the hosts,
82
+ // not of this bucket, which is why the bucket is the one that must stay.
83
+ BLOCK_MESSAGE_REJECTED: 'no-reply',
75
84
  BLOCK_READY: 'no-reply',
76
85
  NAVIGATE: 'no-reply',
77
86
  // Human-gated in SPIRIT, but the host never replies — a grant arrives later as
@@ -1 +1 @@
1
- {"version":3,"file":"requestTimeouts.js","sourceRoot":"","sources":["../../src/internal/requestTimeouts.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,MAAM,CAAC;AAWxD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,qBAAqB,GAAG;IAC5B,2EAA2E;IAC3E,kBAAkB,EAAE,OAAO,EAAE,wCAAwC;IACrE,sBAAsB,EAAE,OAAO,EAAE,8BAA8B;IAC/D,iBAAiB,EAAE,OAAO,EAAE,kCAAkC;IAC9D,oBAAoB,EAAE,OAAO,EAAE,gCAAgC;IAC/D,0BAA0B,EAAE,OAAO,EAAE,4CAA4C;IACjF,0EAA0E;IAC1E,4EAA4E;IAC5E,wEAAwE;IACxE,4EAA4E;IAC5E,uEAAuE;IACvE,wEAAwE;IACxE,wEAAwE;IACxE,qBAAqB,EAAE,OAAO;IAC9B,4EAA4E;IAC5E,6EAA6E;IAC7E,6EAA6E;IAC7E,0EAA0E;IAC1E,6EAA6E;IAC7E,sEAAsE;IACtE,8EAA8E;IAC9E,qEAAqE;IACrE,oBAAoB,EAAE,OAAO;IAE7B,2EAA2E;IAC3E,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,UAAU;IACvB,QAAQ,EAAE,UAAU;IACpB,+EAA+E;IAC/E,wEAAwE;IACxE,eAAe,EAAE,UAAU;IAC3B,eAAe,EAAE,UAAU;IAC3B,aAAa,EAAE,UAAU;IACzB,WAAW,EAAE,UAAU;IAEvB,2EAA2E;IAC3E,kBAAkB,EAAE,UAAU;IAC9B,eAAe,EAAE,UAAU;IAC3B,gBAAgB,EAAE,UAAU;IAC5B,iBAAiB,EAAE,UAAU;IAC7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AAC;AAE5B;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAU,SAAsD,CAAC;AAC7F,KAAK,sBAAsB,CAAC;AAE5B,MAAM,wBAAwB,GAAU,SAAmD,CAAC;AAC5F,KAAK,wBAAwB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAClC;KACE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;KACnD,IAAI,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civitai/blocks-react",
3
- "version": "0.52.0",
3
+ "version": "0.53.1",
4
4
  "description": "React hooks and iframe transport for Civitai Apps. Pairs with @civitai/app-sdk/blocks.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,8 +35,41 @@
35
35
  "@civitai/theme": "0.3.1"
36
36
  },
37
37
  "comment-peerDependencies": [
38
- "The @civitai/app-sdk floor is DERIVED, not chosen: 0.40.0 is the lowest",
39
- "published version that exports every symbol this package imports from the peer.",
38
+ "The @civitai/app-sdk floor is DERIVED, not chosen: it is the lowest published",
39
+ "version that exports every symbol this package imports from the peer.",
40
+ "",
41
+ "🔴 RAISED 0.40.0 -> 0.45.0 when this package began importing two NEW peer VALUE",
42
+ "symbols -- `boundBlockToParentMessageType` and `OTHER_MESSAGE_TYPE_LABEL`, used by",
43
+ "`internal/iframeTransport.ts` to bound the `BLOCK_MESSAGE_REJECTED` label. Both",
44
+ "ship for the first time in the app-sdk minor released alongside this change, so",
45
+ "0.45.0 is not a margin: it is the first version that has them. Measured against",
46
+ "the then-latest published 0.44.0 -- which SATISFIED the old range -- both are",
47
+ "absent from every subpath, and the failure is not a type error: `dist/index.js`",
48
+ "re-exports `IframeTransport`, so the package's MAIN ENTRY is in the failing module",
49
+ "graph and the block does not boot at all. Caught by an adversarial audit that",
50
+ "built the dist and resolved it, not by any gate; the paragraph below says why no",
51
+ "gate can. Step 4's positive control was run (a symbol that cannot exist reported",
52
+ "as absent), so the zero for the other symbols is a measurement and not a silent",
53
+ "pass.",
54
+ "",
55
+ "⚠️ 0.45.0 IS A PREDICTION ABOUT RELEASE ORDERING, NOT A MEASURED VERSION. It is",
56
+ "what the pending minor changeset publishes ONCE THIS BRANCH IS ON TOP OF a main",
57
+ "where app-sdk is already 0.44.0 and the catalog changeset has been consumed. If",
58
+ "another minor releases FIRST, the two symbols ship in 0.46.0 while 0.45.0",
59
+ "publishes WITHOUT them and SATISFIES this range -- #309's shape exactly, the one",
60
+ "this floor exists to close.",
61
+ "",
62
+ "🔴 AND `changeset version` WILL REWRITE THIS RANGE DOWNWARD IF IT RUNS TOO EARLY.",
63
+ "An earlier revision of this note said onlyUpdatePeerDependentsWhenOutOfRange",
64
+ "'guarantees changeset version will not correct it'. That is BACKWARDS, and it is",
65
+ "measured: run on this branch as it stands (app-sdk 0.43.0 in-tree, the catalog",
66
+ "changeset still present, so app-sdk computes to 0.44.0), `changeset version`",
67
+ "rewrites `>=0.45.0 <1.0.0` to `>=0.44.0` -- it LOWERS the floor to the exact",
68
+ "version that lacks the symbols AND drops the upper bound. The flag rewrites a",
69
+ "peer range precisely when the computed version falls OUT of it. Post-merge it",
70
+ "computes 0.45.0 and leaves the range alone, which is why this is not a live",
71
+ "defect -- but never run `changeset version` on this branch before rebasing, and",
72
+ "re-read the range afterwards rather than trusting the flag to protect it.",
40
73
  "",
41
74
  "🔴 A PEER RANGE IS METADATA AND NOTHING CHECKS IT AGAINST THE CODE. 0.49.0-0.51.0",
42
75
  "declared >=0.29.0 while importing `effectiveBrowsingCeiling` (app-sdk 0.39.0) and",
@@ -56,7 +89,7 @@
56
89
  "TO RE-DERIVE IT (do this when this package starts importing a new peer symbol):",
57
90
  " 1. collect the symbols -- every named `import`/`export … from '@civitai/app-sdk*'`",
58
91
  " clause in src/, plus bare and star forms, which name a SUBPATH and no symbols",
59
- " but still have to resolve. At the time of writing: 60 symbols, 2 subpaths",
92
+ " but still have to resolve. At the time of writing: 62 symbols, 2 subpaths",
60
93
  " ('/blocks' and '/safe-storage').",
61
94
  " 2. in a scratch dir OUTSIDE this workspace (pnpm would resolve the peer to the",
62
95
  " workspace copy and measure nothing), `npm i @civitai/app-sdk@<version>` and",
@@ -74,7 +107,7 @@
74
107
  "the tool was the expensive half."
75
108
  ],
76
109
  "peerDependencies": {
77
- "@civitai/app-sdk": ">=0.40.0 <1.0.0",
110
+ "@civitai/app-sdk": ">=0.45.0 <1.0.0",
78
111
  "react": "^18.0.0 || ^19.0.0"
79
112
  },
80
113
  "devDependencies": {
@@ -89,7 +122,7 @@
89
122
  "react-dom": "^19.0.0",
90
123
  "typescript": "^5.9.2",
91
124
  "vitest": "^4.1.11",
92
- "@civitai/app-sdk": "^0.43.0"
125
+ "@civitai/app-sdk": "^0.46.0"
93
126
  },
94
127
  "publishConfig": {
95
128
  "access": "public"