Error: Data passed to getter must include an id property (it's how we memoize) but got undefined at window.WWebJS.getContactModel. #1937
danewellxp-glitch
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
Description
When calling
GET /api/contacts/all, the endpoint returns HTTP 500 with the following error:This happens consistently whenever I try to fetch all contacts from a registered session.
Steps to Reproduce
GET /api/{session}/contacts/allExpected Behavior
Return a list of all contacts from the connected WhatsApp account.
Actual Behavior
The API crashes with the error above. It seems the WWebJS engine
encounters a contact with a malformed or missing
idproperty(possibly a corrupted/legacy contact in the phone's address book),
and instead of skipping it, the whole call fails.
Possible Cause
The
getContactModelfunction in whatsapp-web.js requires anidfield for memoization. When iterating over all contacts, if any single
contact has an undefined or malformed ID, the entire request throws
and returns 500.
Workaround / Request
Could WAHA (or the underlying WWebJS layer) catch this error per-contact
and skip malformed entries instead of failing the entire request?
A try/catch around individual contact processing would prevent the full
endpoint from crashing.
Beta Was this translation helpful? Give feedback.
All reactions