Commit 40c7757
refactor: delegate handler-lifecycle done-signal to HandlerLifecycle util (#440)
The three event-wrapper callbacks (_on_event_start/_on_event_end/
_on_event_error) emitted the internal workshop->core done-signal trio
(mycroft.skill.handler.{start,complete,error}) by hand. Delegate that
emission to the shared ovos_bus_client.handler.HandlerLifecycle util
(#246) so the wire format lives in one place.
Pure DRY: same topics, same payloads ({'name': <handler>} on
start/complete, + {'exception': repr(error)} on error), same
context['skill_id'] stamping and preserved session. The util stamps
skill_id on the forwarded copy rather than mutating the caller's
message, and builds a fresh payload per emission instead of mutating
the shared skill_data dict.
Preserved (NOT part of the trio): _on_event_end still emits
ovos.utterance.handled when is_intent and still runs settings.store();
_on_event_error still speaks the skill.error dialog and logs the
exception (the util deliberately does not speak).
Bumps the ovos-bus-client floor to >=2.6.0a1 (carries the util).
Fills the previously-stubbed test_on_event_{start,end,error} tests,
asserting the emitted topic/payload/context is unchanged.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7be1f20 commit 40c7757
3 files changed
Lines changed: 103 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
1454 | 1455 | | |
1455 | 1456 | | |
1456 | 1457 | | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1461 | 1463 | | |
1462 | 1464 | | |
1463 | 1465 | | |
| |||
1467 | 1469 | | |
1468 | 1470 | | |
1469 | 1471 | | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1474 | 1476 | | |
1475 | 1477 | | |
1476 | 1478 | | |
| |||
1492 | 1494 | | |
1493 | 1495 | | |
1494 | 1496 | | |
1495 | | - | |
1496 | | - | |
1497 | 1497 | | |
1498 | 1498 | | |
1499 | | - | |
1500 | | - | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1501 | 1503 | | |
1502 | | - | |
1503 | | - | |
| 1504 | + | |
| 1505 | + | |
1504 | 1506 | | |
1505 | 1507 | | |
1506 | 1508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
300 | 317 | | |
301 | | - | |
302 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
303 | 342 | | |
304 | 343 | | |
305 | | - | |
306 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
307 | 371 | | |
308 | 372 | | |
309 | | - | |
310 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
311 | 391 | | |
312 | 392 | | |
313 | 393 | | |
| |||
0 commit comments