zanzara icon indicating copy to clipboard operation
zanzara copied to clipboard

Telegram update TypeError logs

Open hamidqp opened this issue 2 years ago • 5 comments

Hi, todays the only thing i get from logs are bunch of these, but idk what could cause this problem, I guess the more users bot have the more these logs showing up. Also im using the tdlight telegram bot api.

Failed to process Telegram update , reason: TypeError: Zanzara\Telegram\Type\Update::getUpdateType(): Return value must be of type string, null returned in /vendor/badfarm/zanzara/src/Zanzara/Telegram/Type/Update.php:339
Stack trace:
#0 /vendor/badfarm/zanzara/src/Zanzara/Listener/ListenerResolver.php(34): Zanzara\Telegram\Type\Update->getUpdateType()
#1 /vendor/badfarm/zanzara/src/Zanzara/UpdateMode/UpdateMode.php(88): Zanzara\Listener\ListenerResolver->resolveListeners()
#2 /vendor/badfarm/zanzara/src/Zanzara/UpdateMode/Polling.php(78): Zanzara\UpdateMode\UpdateMode->processUpdate()
#3 /vendor/react/promise/src/FulfilledPromise.php(28): Zanzara\UpdateMode\Polling->Zanzara\UpdateMode\{closure}()
#4 /vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then()
#5 /vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}()
...

hamidqp avatar Oct 18 '21 10:10 hamidqp

Hi, probably it is an update type we haven't managed. Can you tell us for which update it happens?

cheeghi avatar Oct 18 '21 18:10 cheeghi

Hello, I have very same problem but it comes from nowhere! there is no new messages that cause this and i guess maybe just because the response of the get update is weird it pop this out.

awohsen avatar Mar 16 '22 21:03 awohsen

image

I did find one of them! by placing var_dump before mapping.

ChatJoinRequest That came on from Bot API 5.4

awohsen avatar Apr 26 '22 14:04 awohsen

image

Another one from ChatMemberUpdated introduced in Bot API 5.1

awohsen avatar Apr 26 '22 14:04 awohsen

So it's not about the new not managed update types(since they are imported already), we need to have custom listeners for each one of the update types or at least help them go throw the global onUpdate listener.

Updates like the two above I mentioned are not getting to onUpdate because they don't get initialized on getUpdateType.

awohsen avatar Apr 26 '22 15:04 awohsen