Commit 7975f2d
fix(plugin-calendar): gate ObjectCalendar's standalone query on the object schema (#6484)
* fix(plugin-calendar): gate ObjectCalendar's standalone query on the object schema
The fetch effect built its expand set from `objectSchemaRef.current`, a ref
assigned in the render body, and deliberately omitted `objectSchema` from its
dependency list. That bought one effect run per mount and paid for it with the
expansion, permanently: on that one run the ref was still null,
`buildExpandFields` saw no fields, and the query went out with no `$expand` at
all — and nothing re-ran the effect when the schema landed.
Only the standalone `object-calendar` with `dataConfig.provider === 'object'`
reaches this path; one hosted by ObjectView or ListView takes its rows from the
parent, which objectui#6419 already covers. On the standalone calendar every
lookup / master_detail / user / tree field rendered from its raw foreign-key id.
The ref is replaced by a settled-and-keyed resolution (`{ key, def } | null`)
that GATES the record query — the third member of the family after objectui#6271
(ObjectKanban) and objectui#6419 (ObjectView), written as a third copy rather
than an extraction because neither of those landed a shared helper and this
component's key and gate scope both diverge from theirs.
Measured on this component, not inherited. Instrumented adapter, rows tagged
with the query that produced them, observations read from the DOM and from real
child commits, three latency profiles:
before 1 find, `$expand` NEVER present. Raw ids paint and stay.
`objectSchema` 2 finds. Schema slower: raw ids at 30ms, back to the
in the deps "Loading calendar..." placeholder at 71ms, expanded at
94ms — a three-step paint. Schema faster: the first
response is discarded on arrival.
gated 1 find carrying `$expand` the first time, in all three
profiles; one paint, expanded, at 107/88/78ms vs
108/94/79ms via the deps.
The gate is on the read having SETTLED, never on a truthy schema: an adapter
with no `getObjectSchema` and a read that throws both settle with nothing and
the calendar still queries, unexpanded. The gate is scoped to the `object`
provider because an inline `value` set issues no metadata read at all — a
whole-effect gate would hold its query open on a resolution nothing produces.
No public surface change: no `index.ts` touched, no export added or removed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011SfZeFWrhGLHmfq61xbz4q
* test(plugin-calendar): record which expand-gate pins actually discriminate
Reverse verification against the branch's base commit turned SIX of the nine
pins red, not four: the REJECTS pin discriminates too, through its ordering
assertion (`['find', 'schema:issued']` against the base — the query went out
before the schema was even requested). The docstring claimed it could not.
Corrected to the measured result, and the three pins that genuinely stay green
in both directions are now named with the reason each still earns its place.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011SfZeFWrhGLHmfq61xbz4q
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 622f33c commit 7975f2d
3 files changed
Lines changed: 513 additions & 23 deletions
File tree
- .changeset
- packages/plugin-calendar/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
240 | | - | |
241 | | - | |
242 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
243 | 272 | | |
244 | 273 | | |
245 | 274 | | |
| |||
259 | 288 | | |
260 | 289 | | |
261 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
262 | 308 | | |
263 | 309 | | |
264 | 310 | | |
| |||
280 | 326 | | |
281 | 327 | | |
282 | 328 | | |
283 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
284 | 334 | | |
285 | 335 | | |
286 | 336 | | |
| |||
309 | 359 | | |
310 | 360 | | |
311 | 361 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
315 | 371 | | |
| 372 | + | |
| 373 | + | |
316 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
317 | 384 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 385 | + | |
| 386 | + | |
328 | 387 | | |
329 | 388 | | |
| 389 | + | |
330 | 390 | | |
331 | 391 | | |
332 | 392 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
337 | 396 | | |
338 | 397 | | |
339 | 398 | | |
| |||
0 commit comments