Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken web chat - cannot read properties of undefined #157

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

JayDi85
Copy link
Contributor

@JayDi85 JayDi85 commented Sep 27, 2023

Current web chat broken and can't process income user messages due error:

TypeError: Cannot read properties of undefined (reading 'toString')

That's PR fix the problem with wrong/undefined group settings for web messages. Now it uses same default values as direct tg messages. New version works fine with it (tg and web messages).

Original error stack:

=== UNHANDLED ERROR ===
[ERROR] 14:00:04 TypeError: Cannot read properties of undefined (reading 'toString')
...
Error:  TypeError: Cannot read properties of undefined (reading 'toString')
    at Object.msg (C:\WORK\xxx\telegram-support-bot\src\middleware.ts:67:10)
    at C:\WORK\xxx\telegram-support-bot\src\users.ts:126:22
    at Object.getOpen (C:\WORK\xxx\telegram-support-bot\src\db.ts:42:3)
    at Object.chat (C:\WORK\xxx\telegram-support-bot\src\users.ts:91:8)
    at C:\WORK\xxx\telegram-support-bot\src\text.ts:51:17
    at Object.getOpen (C:\WORK\xxx\telegram-support-bot\src\db.ts:42:3)
    at ticketHandler (C:\WORK\xxx\telegram-support-bot\src\text.ts:44:8)
    at Socket.<anonymous> (C:\WORK\xxx\telegram-support-bot\src\addons\web.ts:56:26)
    at Socket.emit (node:events:513:28)
    at Socket.emitUntyped (C:\WORK\xxx\telegram-support-bot\node_modules\socket.io\dist\typed-events.js:69:22)

Closes #141

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello there! As you are a first time Contributor please make sure that you are using the predefined eslint guidelines for your code formatting. Thank you! Now continue :)

@bostrot bostrot merged commit db032ea into bostrot:master Sep 27, 2023
4 checks passed
@JayDi85 JayDi85 deleted the patch-1 branch September 27, 2023 17:04
@gituser gituser mentioned this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending message from WEB isn't working
2 participants