Commit 8af96fc
* Fix crash in digging plugin death handler when bot._events is undefined
When the bot dies during certain states (e.g. Velocity proxy transfers,
or when using Bun runtime), the EventEmitter internals can be torn down
before the death event fires. This causes removeAllListeners to throw
"TypeError: undefined is not an object (evaluating 'this._events')".
Wrapping the death handler in a try/catch prevents the crash.
Fixes #3553
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add test for digging death handler crash fix
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add external test for digging death crash fix
Verifies that killing the bot mid-dig via /kill doesn't crash, by
placing a block, starting to dig it in survival mode, killing the bot,
and confirming the death event fires and the bot respawns.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(test): reset state after diggingDeath to prevent cascading failures
After killing the bot, wait for chunks to load at the respawn point and
call resetState() so subsequent tests start with a clean creative-mode
bot at the origin with loaded chunks. Without this, the next test's
resetState() would fail with "Timeout waiting for chunks" or
"updateSlot did not fire" because the bot was still at the respawn
location without chunks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove flaky diggingDeath external test (covered by unit test)
---------
Co-authored-by: Simeon Kummer <simeon@hitthecode.de>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: rom1504 <rom1504@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
1 parent dcbc5b2 commit 8af96fc
2 files changed
Lines changed: 95 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
0 commit comments