Commit 899e42c
Address PR #905 review comments: third batch
Safety and robustness fixes from consolidated review:
Backend:
- C-1: Guard on_message against JSON/key errors (malformed WS messages)
- C-2: Guard ScriptRoom.apply_update and send COLLAB_ERROR on failure
- C-3: Add finally to on_close _broadcast to guarantee close_active_room runs
- C-4: Wrap on_close DB cleanup in try/except to prevent silent failures
- C-5: Null-guard session entry in REQUEST_SCRIPT_EDIT/CUTS (race with on_close)
- C-8: Fix no_active_script_draft null guard for missing script/revision
- H-1: Add RBAC guards (editor check + Role.WRITE) to SAVE/DISCARD_SCRIPT_DRAFT
- H-2: Broadcast COLLAB_ERROR warning when show changes while draft is active
- H-3: Move blocking file I/O to run_in_executor in checkpoint/load/delete
- H-4/H-5: Distinguish WebSocketClosedError (debug) from unexpected errors (warning)
- H-6: Log notification failures in save_room instead of silently swallowing
- H-11: Notify clients via COLLAB_ERROR before discarding a corrupt draft file
- M-7: Remove manual self.on_close() call from write_message (Tornado handles it)
- M-8: Null-guard digi_settings.get("current_show") in on_close
- SQ-4: Add explanatory comments to intentionally empty Alembic migration
Frontend:
- C-6: Remove orphaned setupAutoSave() call in saveScript()
- C-7: Apply _unwrapYjsValue() to keyed initial population in useYMap()
- H-7: Surface sync timeout failure to user via SET_SYNC_ERROR + toast watcher
- H-8: Surface COLLAB_ERROR to user via SET_COLLAB_ERROR + toast watcher
- H-9: Fix discardAndStartFresh to only hide modal on success; add error toasts
- H-10: Show warning toast when getMaxScriptPage() fails
- M-3: Return false from applySync/applyUpdate/applyAwareness catch blocks
- M-9: Add null guards in _ydocLineToPlain for missing parts; wrap _syncLocalPageScript in try/catch
- M-13: Fix applyAwareness to return false for empty/failed payloads (was true)
All 709 backend tests and 136 frontend tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e94d2d3 commit 899e42c
File tree
10 files changed
+338
-81
lines changed- client/src
- store/modules
- utils/yjs
- vue_components/show/config/script
- server
- alembic_config/versions
- controllers
- digi_server
- utils
- web
10 files changed
+338
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| |||
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| 100 | + | |
| 101 | + | |
92 | 102 | | |
93 | 103 | | |
94 | 104 | | |
| |||
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | | - | |
| 143 | + | |
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| |||
140 | 150 | | |
141 | 151 | | |
142 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
143 | 158 | | |
144 | 159 | | |
145 | 160 | | |
| |||
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
221 | | - | |
222 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
223 | 240 | | |
224 | 241 | | |
225 | 242 | | |
| |||
275 | 292 | | |
276 | 293 | | |
277 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
278 | 301 | | |
279 | 302 | | |
280 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
142 | 145 | | |
143 | | - | |
144 | | - | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 38 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
455 | 467 | | |
456 | 468 | | |
457 | 469 | | |
| |||
543 | 555 | | |
544 | 556 | | |
545 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
546 | 561 | | |
547 | 562 | | |
548 | 563 | | |
| |||
563 | 578 | | |
564 | 579 | | |
565 | 580 | | |
566 | | - | |
567 | 581 | | |
568 | 582 | | |
| 583 | + | |
569 | 584 | | |
570 | 585 | | |
571 | 586 | | |
572 | 587 | | |
| 588 | + | |
573 | 589 | | |
574 | 590 | | |
575 | 591 | | |
| |||
581 | 597 | | |
582 | 598 | | |
583 | 599 | | |
| 600 | + | |
| 601 | + | |
584 | 602 | | |
585 | 603 | | |
586 | 604 | | |
| |||
799 | 817 | | |
800 | 818 | | |
801 | 819 | | |
802 | | - | |
803 | 820 | | |
804 | 821 | | |
805 | 822 | | |
| |||
840 | 857 | | |
841 | 858 | | |
842 | 859 | | |
| 860 | + | |
843 | 861 | | |
844 | | - | |
| 862 | + | |
845 | 863 | | |
846 | 864 | | |
847 | | - | |
848 | | - | |
| 865 | + | |
| 866 | + | |
849 | 867 | | |
850 | 868 | | |
851 | | - | |
| 869 | + | |
852 | 870 | | |
853 | 871 | | |
854 | 872 | | |
855 | 873 | | |
856 | | - | |
857 | | - | |
858 | | - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
859 | 877 | | |
860 | 878 | | |
861 | 879 | | |
| |||
869 | 887 | | |
870 | 888 | | |
871 | 889 | | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
879 | 901 | | |
880 | 902 | | |
881 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
0 commit comments