Skip to content

Incorrect management of Timeouts #1

Open
@ghost

Description

Using this library, timeouts typically happen in the background, but end up crashing the nodejs server.
Its simply because in resolving these timeouts, the library tries to delete a variable that is undefined.

/app/node_modules/json-rpc-dual-engine/lib/json-rpc/json-rpc-client.js:42
() => delete this[PRIVATE.PENDING_CALLS][id],
^

TypeError: Cannot convert undefined or null to object
at /app/node_modules/json-rpc-dual-engine/lib/json-rpc/json-rpc-client.js:42:45
at Timeout._onTimeout (/app/node_modules/json-rpc-dual-engine/lib/util/timeout-promise
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)

I corrected the issue for me by doing () => delete this[PRIVATE.PENDING_CALLS]?.[id]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions