Commit 3598ef8
Fix preview generation race condition when toggling filters rapidly
Concurrent _generateProcessedPreview() calls (fired from non-awaited timer
callbacks) would clobber each other's cancel tokens and prematurely clear
the isGeneratingPreview flag, causing previews to silently stop updating.
Add a generation counter so only the most recent call updates shared state,
use a local cancel token reference instead of the instance variable, and
guard _previewProcess cleanup to avoid nulling a newer call's process.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c0eaf9d commit 3598ef8
2 files changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | | - | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| |||
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
302 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
| |||
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
325 | 330 | | |
326 | 331 | | |
327 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
785 | 786 | | |
786 | 787 | | |
787 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
788 | 794 | | |
789 | 795 | | |
790 | 796 | | |
791 | 797 | | |
792 | 798 | | |
793 | 799 | | |
794 | 800 | | |
| 801 | + | |
| 802 | + | |
795 | 803 | | |
796 | 804 | | |
797 | 805 | | |
798 | | - | |
| 806 | + | |
| 807 | + | |
799 | 808 | | |
800 | 809 | | |
801 | 810 | | |
| |||
804 | 813 | | |
805 | 814 | | |
806 | 815 | | |
807 | | - | |
| 816 | + | |
808 | 817 | | |
809 | 818 | | |
810 | | - | |
| 819 | + | |
811 | 820 | | |
812 | 821 | | |
813 | 822 | | |
814 | 823 | | |
815 | 824 | | |
816 | 825 | | |
817 | | - | |
818 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
819 | 832 | | |
820 | 833 | | |
821 | 834 | | |
| |||
0 commit comments