Refactor: Fix Event Buffer Deadlock with State Machine (#1633)

* feat: implement state machine for chat synchronization and buffer management

* test: Add Jest configuration and tests for connection deadlock handling

- Created a Jest configuration file to set up testing environment.
- Implemented utility functions for creating isolated authentication sessions and mocking WebSocket connections.
- Added a test case to ensure that the connection does not deadlock when history sync is disabled, verifying the correct handling of message events.

* feat: add GitHub Actions workflow for running tests

* chore: sort import lint

* fix: implement timeout handling for AwaitingInitialSync state in chat socket, maybe fix memory leak

* feat: enhance chat synchronization by refining AwaitingInitialSync handling and adding history sync checks
This commit is contained in:
João Lucas de Oliveira Lopes
2025-08-06 19:15:41 -03:00
committed by GitHub
parent 1a721bb242
commit 812e53e4eb
13 changed files with 1137 additions and 717 deletions
+4 -3
View File
@@ -36,7 +36,7 @@
"prepare": "npm run build",
"preinstall": "node ./engine-requirements.js",
"release": "release-it",
"test": "jest"
"test": "node --experimental-vm-modules ./node_modules/.bin/jest"
},
"dependencies": {
"@cacheable/node-cache": "^1.4.0",
@@ -59,10 +59,11 @@
"@typescript-eslint/parser": "^8.32.0",
"@whiskeysockets/eslint-config": "github:whiskeysockets/eslint-config",
"conventional-changelog-cli": "^2.2.2",
"esbuild-register": "^3.6.0",
"eslint": "^9.31.0",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.4.0",
"jest": "^29.7.0",
"jest": "^30.0.5",
"jimp": "^1.6.0",
"jiti": "^2.4.2",
"json": "^11.0.0",
@@ -71,7 +72,7 @@
"prettier": "^3.5.3",
"protobufjs-cli": "^1.1.3",
"release-it": "^15.10.3",
"ts-jest": "^29.3.2",
"ts-jest": "^29.4.0",
"tsc-esm-fix": "^3.1.2",
"tsx": "^4.20.3",
"typedoc": "^0.27.9",