Cursor experienced a critical memory leak bug that caused automatic deletion of a project directory while the user was working, resulting in data loss despite no user action being logged

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor experienced a catastrophic failure resulting in the complete deletion of a project directory while the application was running. The incident was preceded by severe memory leaks in the renderer process, with listener counts escalating from 175 to 676+ listeners, causing system instability and eventual file system corruption.
Key Issues:

  • Directory Deletion: Entire project folder was deleted while Cursor was active
  • Memory Leaks: Massive listener leak accumulation (50+ instances)
  • UI Corruption: Repeated “deltaDecorations recursively” errors (20+ instances)
  • TypeScript Server Crashes: Multiple server failures
  • File Watcher Failure: Watcher shutdown due to deleted path
  • No User Action Logged: No keyboard shortcuts or commands recorded

Steps to Reproduce

  1. Open a project in Cursor with git repository
  2. Work on files for extended period (2+ hours)
  3. Observe memory leak warnings in logs:
    • potential listener LEAK detected, having X listeners already
    • Invoking deltaDecorations recursively could lead to leaking decorations
  4. Continue working as memory leaks escalate
  5. Result: Project directory gets deleted automatically

Note: This appears to be a systemic issue that may not be easily reproducible but represents a critical data loss scenario.

Expected Behavior

  • Cursor should maintain stable memory usage
  • Project directories should never be deleted without explicit user action
  • Memory leaks should be prevented or automatically cleaned up
  • File system operations should be protected from application crashes
  • User should receive warnings before any destructive operations

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.9 (Universal)
VSCode Version: 1.99.3
Commit: de327274300c6f38ec9f4240d11e82c3b0660b20
Date: 2025-08-30T21:02:27.236Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.0.0

Additional Information

Logs (renderer.log):
2025-09-03 20:34:13.934 [error] [1b3] potential listener LEAK detected, having 175 listeners already. MOST frequent listener (1):: Error
2025-09-03 20:34:13.935 [error] [1b4] potential listener LEAK detected, having 175 listeners already. MOST frequent listener (1):: Error
2025-09-03 20:34:20.905 [error] [062] potential listener LEAK detected, having 520 listeners already. MOST frequent listener (14):: Error
2025-09-03 20:34:20.907 [error] [74e] potential listener LEAK detected, having 175 listeners already. MOST frequent listener (1):: Error
2025-09-03 20:34:31.543 [error] [062] potential listener LEAK detected, having 621 listeners already. MOST frequent listener (62):: Error
2025-09-03 20:34:54.277 [error] [224] potential listener LEAK detected, having 373 listeners already. MOST frequent listener (29):: Error
2025-09-03 20:34:55.052 [error] An unknown error occurred. Please consult the log for more details. {}
2025-09-03 20:35:03.309 [error] [062] potential listener LEAK detected, having 565 listeners already. MOST frequent listener (21):: Error
2025-09-03 20:35:03.628 [error] [1bb] potential listener LEAK detected, having 245 listeners already. MOST frequent listener (16):: Error
2025-09-03 20:35:04.303 [error] An unknown error occurred. Please consult the log for more details. {}
2025-09-03 20:35:20.014 [error] [062] potential listener LEAK detected, having 623 listeners already. MOST frequent listener (67):: Error
2025-09-03 20:35:22.076 [error] [062] potential listener LEAK detected, having 676 listeners already. MOST frequent listener (66):: Error
2025-09-03 20:35:22.411 [error] [062] potential listener LEAK detected, having 671 listeners already. MOST frequent listener (63):: Error
2025-09-03 20:35:22.757 [error] [062] potential listener LEAK detected, having 633 listeners already. MOST frequent listener (55):: Error
2025-09-03 20:35:23.054 [error] [062] potential listener LEAK detected, having 623 listeners already. MOST frequent listener (53):: Error
2025-09-03 20:35:23.307 [error] [062] potential listener LEAK detected, having 638 listeners already. MOST frequent listener (52):: Error
2025-09-03 20:37:07.745 [error] [062] potential listener LEAK detected, having 546 listeners already. MOST frequent listener (17):: Error
2025-09-03 20:37:32.692 [error] Invoking deltaDecorations recursively could lead to leaking decorations.: Error: Invoking deltaDecorations recursively could lead to leaking decorations.
2025-09-03 20:37:39.285 [error] TypeScript Server Error (5.8.2)
2025-09-03 20:37:44.331 [error] Invoking deltaDecorations recursively could lead to leaking decorations.: Error: Invoking deltaDecorations recursively could lead to leaking decorations.
2025-09-03 20:37:57.876 [error] [74b] potential listener LEAK detected, having 194 listeners already. MOST frequent listener (6):: Error
2025-09-03 20:37:58.223 [error] [1d0] potential listener LEAK detected, having 191 listeners already. MOST frequent listener (5):: Error
2025-09-03 20:38:08.116 [error] An unknown error occurred. Please consult the log for more details. {}

Impact:

  • Data Loss: Complete project directory deletion
  • Work Lost: Hours of development work
  • Recovery Required: Manual restoration from git repository
  • Trust Issues: Fear of future data loss

Does this stop you from using Cursor?
YES - This is a CRITICAL bug that causes DATA LOSS. While the work was recoverable from git, this represents an unacceptable risk for any development work.

Does this stop you from using Cursor

Yes - Cursor is unusable