diff options
| author | naoNao89 <90588855+naoNao89@users.noreply.github.com> | 2025-07-31 05:29:42 +0700 |
|---|---|---|
| committer | naoNao89 <90588855+naoNao89@users.noreply.github.com> | 2025-07-31 05:29:42 +0700 |
| commit | a1d2fbd96bb6713c3172198d71e94274af409aee (patch) | |
| tree | b8bf5c16f221462272512377331204b6290607a9 /apps/web/src/components/ui/scroll-area.tsx | |
| parent | e6e08057f510e70c956af0f0c08c6eef349edf3c (diff) | |
| download | opencut-a1d2fbd96bb6713c3172198d71e94274af409aee.tar.gz | |
[Editor] Prevent excessive project creation from invalid routes
Race conditions in useEffect hook caused navigation to invalid project IDs
to create multiple 'Untitled Project' entries. Users reported accumulating
885+ projects due to this bug.
This change adds global invalid project ID tracking across component remounts
and prevents race conditions through:
- Global invalidProjectIds Set in project store with tracking functions
- isInitializingRef to prevent duplicate initialization attempts
- Proper useEffect cleanup with cancellation tokens
- Specific error handling for 'not found' vs recoverable errors
- Removed problematic activeProject?.id dependency
Testing:
- Add comprehensive test suite (15 tests) with Vitest + React Testing Library
- Include integration tests demonstrating bug and validating fix
- Update CI pipeline to run automated tests
Fixes #182
Diffstat (limited to 'apps/web/src/components/ui/scroll-area.tsx')
0 files changed, 0 insertions, 0 deletions
