-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[WEBJS] - GET /api/:session/lids/:lid can return HTTP 500 instead of a safe null result` #1986
Description
Describe the bug
On WEBJS, GET /api/:session/lids/:lid can return HTTP 500 during LID-to-phone resolution.
This looks like a WAHA-layer issue because the WEBJS implementation does not handle this path as defensively as the other LID-related methods.
Version
{
"version": "2026.3.2",
"engine": "WEBJS",
"tier": "PLUS"
}
Steps
Use a WEBJS session that is connected/WORKING.
Call GET /api/:session/lids/:lid.
Sometimes the endpoint returns HTTP 500 instead of a safe result.
Expected behavior
If the mapping is unavailable or not ready, the endpoint should return a safe response such as pn: null, or fail in a controlled/non-500 way.
Requests - Responses
Example request:
GET /api//lids/@lid
Example response shape from logs:
{
"statusCode": 500,
"exception": {
"stack": "... WebjsClientPlus.findPNByLid ... LidsController.findPNByLid ..."
}
}
Additional context
In the WEBJS implementation:
getAllLids() calls warmUpAllLidPnMappings()
getLidsCount() also calls warmUpAllLidPnMappings()
but findPNByLid() does not
findPNByLid() also directly calls window.Store.LidUtils.getPhoneNumber(wid) without defensive checks.