Commit 4f24962
committed
refactor(live_component): keep _AutoRefresh.__name__ honest via __coco_subpath_name__
The previous implementation overrode `_AutoRefresh.__name__` to the wrapped
fn's name so `coco.mount(auto_refresh(fn, ...))` would derive the same
subpath as `coco.mount(fn)`. That conflated subpath identity with class
identity — tracebacks and `processor_name` in the exception handler
reported the wrapper as if it were the wrapped fn, hiding the live-loop
layer when something went wrong inside the scaffold.
Introduce an opt-in `__coco_subpath_name__` attribute that
`mount`/`use_mount`/`mount_each` consult before falling back to
`__name__`. `auto_refresh` now keeps `_AutoRefresh.__name__` accurate
and only overrides the subpath via the new attribute. Same user-visible
subpath; honest class identity for debugging and for any future wrapper
(or user-defined LiveComponent) that wants the same behavior.1 parent e1c2ed5 commit 4f24962
2 files changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
| |||
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
226 | | - | |
| 243 | + | |
227 | 244 | | |
228 | 245 | | |
229 | 246 | | |
| |||
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
336 | | - | |
| 353 | + | |
337 | 354 | | |
338 | 355 | | |
339 | 356 | | |
| |||
423 | 440 | | |
424 | 441 | | |
425 | 442 | | |
426 | | - | |
| 443 | + | |
427 | 444 | | |
428 | 445 | | |
429 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
590 | | - | |
| 589 | + | |
591 | 590 | | |
0 commit comments