mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Fix uncaught exception in node JSON-RPC tests
Events don't have an `id`, so promises[response.id] does not exist for them. This currently prints a DEP0168 [1] deprecation warning, but will likely return an error in the future. [1] https://nodejs.org/api/all.html#all_deprecations_dep0168-unhandled-exception-in-node-api-callbacks
This commit is contained in:
2
.github/workflows/node-tests.yml
vendored
2
.github/workflows/node-tests.yml
vendored
@@ -59,6 +59,7 @@ jobs:
|
|||||||
npm run test
|
npm run test
|
||||||
env:
|
env:
|
||||||
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
||||||
|
NODE_OPTIONS: '--force-node-api-uncaught-exceptions-policy=true'
|
||||||
- name: Run tests on Windows, except lint
|
- name: Run tests on Windows, except lint
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -67,3 +68,4 @@ jobs:
|
|||||||
npm run test:mocha
|
npm run test:mocha
|
||||||
env:
|
env:
|
||||||
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
|
||||||
|
NODE_OPTIONS: '--force-node-api-uncaught-exceptions-policy=true'
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
### Fixes
|
### Fixes
|
||||||
- Do not add an error if the message is encrypted but not signed #3860
|
- Do not add an error if the message is encrypted but not signed #3860
|
||||||
- Do not strip leading spaces from message lines #3867
|
- Do not strip leading spaces from message lines #3867
|
||||||
|
- Fix uncaught exception in JSON-RPC tests #3884
|
||||||
|
|
||||||
|
|
||||||
## 1.104.0
|
## 1.104.0
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ describe('JSON RPC', function () {
|
|||||||
const promises = {}
|
const promises = {}
|
||||||
dc.startJsonRpcHandler((msg) => {
|
dc.startJsonRpcHandler((msg) => {
|
||||||
const response = JSON.parse(msg)
|
const response = JSON.parse(msg)
|
||||||
promises[response.id](response)
|
if (response.hasOwnProperty('id')) promises[response.id](response)
|
||||||
delete promises[response.id]
|
delete promises[response.id]
|
||||||
})
|
})
|
||||||
const call = (request) => {
|
const call = (request) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user