This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 28be078
fix(skills): guard the DataSource read in the marked data-integration example (#9352)
The marked fence under "Via DataSource methods (in plugin code)" destructured
`dataSource` from `useSchemaContext()` and called `.find()` on it with no
guard. `useSchemaContext()` throws only when there is no PROVIDER; a provider
with no adapter bound is an ordinary, supported state (a Studio preview, a page
that renders before the host connects its adapter, a widget test that drives
`apiFetch` alone), so the published guidance, copied into a plugin on such a
surface, throws at the first call.
Add the guard and move the prose with it, so a reader comes away knowing WHY
the adapter can be absent rather than reading the line as gate appeasement.
The `os:check` marker stays: the example is meant to compile, and dropping the
marker would retire the coverage while leaving the same unguarded pattern
published for readers to copy.
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
Co-authored-by: objectui-agent <yinlianghui@steedos.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2e471dc commit 28be078
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
295 | 303 | | |
296 | 304 | | |
297 | 305 | | |
| |||
301 | 309 | | |
302 | 310 | | |
303 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
304 | 315 | | |
305 | 316 | | |
306 | 317 | | |
| |||
0 commit comments