matrix-org / matrix-org/matrix-bifrost
Uncaught Promise: Cannot read property 'anonymousJid' of undefined
- Dominant language
- TypeScript
- Stars
- 187
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Uncaught promise
```
Feb 22 11:14:28 lethe docker-bifrost[15504]: (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'anonymousJid' of undefined
Feb 22 11:14:28 lethe docker-bifrost[15504]: at XmppJsInstance. (/app/src/xmppjs/XJSGateway.ts:57:80)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at XmppJsInstance.emit (events.js:314:20)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at XmppJsInstance.handleTextMessage (/app/src/xmppjs/XJSInstance.ts:756:18)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at XmppJsInstance.handleMessageStanza (/app/src/xmppjs/XJSInstance.ts:715:21)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at XmppJsInstance.onStanza (/app/src/xmppjs/XJSInstance.ts:491:22)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at Component. (/app/src/xmppjs/XJSInstance.ts:230:22)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at Component.emit (events.js:314:20)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at Component._onElement (/app/node_modules/@xmpp/component-core/node_modules/@xmpp/connection/index.js:106:10)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at Parser.emit (events.js:314:20)
Feb 22 11:14:28 lethe docker-bifrost[15504]: at Parser.onEndElement (/app/node_modules/@xmpp/xml/lib/Parser.js:52:12)
Feb 22 11:14:28 lethe docker-bifrost[15504]: (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 260046)
```
**To Reproduce**
Steps to reproduce the behavior:
Not investigated
**Expected behavior**
No uncaught promises.
**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Start at src/xmppjs/XJSGateway.ts:57 and trace the message-handling path through XJSInstance.ts:756, 715, and 491. Investigate the unhandled promise and the undefined value behind anonymousJid; reproduce the reported stanza-handling case if possible. Done means the case no longer produces an uncaught promise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100