Commit 1d1da60
feat: warn when session$destroy(id) targets a non-existent module scope
session$destroy(id) now emits a warning (class "shiny.destroy.unknown_id")
when the id names a scope that was never created or has already been
destroyed, helping catch typos and stale ids. It's a warning rather than
an error so it doesn't break otherwise-working code, matching how Shiny
treats duplicate output ids (always warn).
Adds a private scopeExists() check to ShinySession and MockShinySession
that runs before makeScope(id) (which would otherwise register its own
callbacks and mask the check). Addresses @khusmann's request on #4372.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1cf4d10 commit 1d1da60
5 files changed
Lines changed: 78 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| |||
587 | 588 | | |
588 | 589 | | |
589 | 590 | | |
| 591 | + | |
590 | 592 | | |
591 | 593 | | |
592 | 594 | | |
| |||
770 | 772 | | |
771 | 773 | | |
772 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
773 | 783 | | |
774 | 784 | | |
775 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
| |||
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
452 | 470 | | |
453 | 471 | | |
454 | 472 | | |
| |||
822 | 840 | | |
823 | 841 | | |
824 | 842 | | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
825 | 853 | | |
826 | 854 | | |
827 | 855 | | |
| |||
1089 | 1117 | | |
1090 | 1118 | | |
1091 | 1119 | | |
| 1120 | + | |
1092 | 1121 | | |
1093 | 1122 | | |
1094 | 1123 | | |
| |||
1293 | 1322 | | |
1294 | 1323 | | |
1295 | 1324 | | |
| 1325 | + | |
1296 | 1326 | | |
1297 | 1327 | | |
1298 | 1328 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
487 | 516 | | |
488 | 517 | | |
489 | 518 | | |
| |||
0 commit comments