Describe the bug
When processing updates using the danog\MadelineProto library, I encountered a RuntimeException due to an autoloader expecting a class named danog\MadelineProto\EventHandler\Pinned which is supposed to be defined in the Pinned.php file. However, the actual class name in the file is PinPinned, leading to a naming mismatch that prevents the autoloader from locating the correct class.
To Reproduce
The issue occurs during the update handling process where an update to pinned messages is being wrapped.
Steps to reproduce the behavior:
Run the MadelineProto event handling loop that processes updates.
When an update to pinned messages is encountered, the error is thrown due to the autoloader's class name expectation.
Expected behavior
I expected the autoloader to locate and load the appropriate class to handle the pinning of messages without any runtime exceptions.
Logs
Here is the sanitized stack trace of the error:
An error occured while wrapping {"_":"updatePinnedMessages","pinned":false,"peer":-419887xxxx,"messages":[846xxx],"pts":208xxxx,"pts_count":0}: RuntimeException: The autoloader expected class "danog\MadelineProto\EventHandler\Pinned" to be defined in file "LOCALPATH/vendor/composer/../danog/madelineproto/src/EventHandler/Pinned.php". The file was found but the class was not in it, the class name or namespace probably has a typo. in LOCALPATH/vendor/symfony/error-handler/DebugClassLoader.php:354
Stack trace:
#0 LOCALPATH/vendor/symfony/error-handler/DebugClassLoader.php(311): Symfony\Component\ErrorHandler\DebugClassLoader->checkClass()
#1 LOCALPATH/vendor/danog/madelineproto/src/EventHandler/Pinned/PinnedGroupMessages.php(25): Symfony\Component\ErrorHandler\DebugClassLoader->loadClass()
#2 LOCALPATH/vendor/symfony/error-handler/DebugClassLoader.php(300): include('...')
#3 LOCALPATH/vendor/danog/madelineproto/src/MTProtoTools/UpdateHandler.php(481): Symfony\Component\ErrorHandler\DebugClassLoader->loadClass()
#4 LOCALPATH/vendor/danog/madelineproto/src/MTProtoTools/UpdateHandler.php(431): danog\MadelineProto\MTProto->wrapPin()
#5 LOCALPATH/vendor/danog/madelineproto/src/MTProtoTools/UpdateHandler.php(212): danog\MadelineProto\MTProto->wrapUpdate()
#6 LOCALPATH/vendor/danog/madelineproto/src/MTProtoTools/UpdateHandler.php(1246): danog\MadelineProto\MTProto->eventUpdateHandler()
#7 LOCALPATH/vendor/danog/madelineproto/src/MTProtoTools/UpdateHandler.php(1240): danog\MadelineProto\MTProto->handleUpdate()
#8 LOCALPATH/vendor/danog/madelineproto/src/Loop/Update/FeedLoop.php(97): danog\MadelineProto\MTProto->saveUpdate()
#9 LOCALPATH/vendor/danog/loop/lib/Loop.php(139): danog\MadelineProto\Loop\Update\FeedLoop->loop()
#10 LOCALPATH/vendor/danog/loop/lib/Loop.php(251): danog\Loop\Loop->loopInternal()
#11 LOCALPATH/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(597): danog\Loop\Loop->danog\Loop\{closure}()
#12 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
#13 LOCALPATH/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(497): Fiber->resume()
#14 LOCALPATH/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(553): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()
#15 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
#16 LOCALPATH/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(94): Fiber->resume()
#17 LOCALPATH/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(117): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
#18 LOCALPATH/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()
#19 LOCALPATH/vendor/danog/madelineproto/src/Wrappers/Loop.php(107): Amp\Future->await()
#20 LOCALPATH/vendor/danog/madelineproto/src/AbstractAPI.php(84): danog\MadelineProto\MTProto->loop()
#21 LOCALPATH/vendor/danog/madelineproto/src/AbstractAPI.php(65): danog\MadelineProto\AbstractAPI->startAndLoopLogic()
#22 LOCALPATH/vendor/danog/madelineproto/src/EventHandler.php(78): danog\MadelineProto\AbstractAPI->startAndLoopInternal()
Environment (please complete the following information):
Version of danog\MadelineProto library: [8.0.0-beta188]
PHP version: [e.g., PHP 8.3]
Additional context
Please advise on the appropriate steps to resolve this issue, whether it is a library update or a usage correction on my end.
Describe the bug When processing updates using the
danog\MadelineProto
library, I encountered aRuntimeException
due to an autoloader expecting a class nameddanog\MadelineProto\EventHandler\Pinned
which is supposed to be defined in thePinned.php
file. However, the actual class name in the file isPinPinned
, leading to a naming mismatch that prevents the autoloader from locating the correct class.To Reproduce The issue occurs during the update handling process where an update to pinned messages is being wrapped.
Steps to reproduce the behavior:
Expected behavior I expected the autoloader to locate and load the appropriate class to handle the pinning of messages without any runtime exceptions.
Logs Here is the sanitized stack trace of the error:
Environment (please complete the following information):
danog\MadelineProto
library: [8.0.0-beta188]Additional context Please advise on the appropriate steps to resolve this issue, whether it is a library update or a usage correction on my end.
Thank you for your attention to this matter.