Xelson / flarum-ext-chat

☁️NeonChat — native realtime chat application for Flarum
https://discuss.flarum.org/d/25361-neon-chat-native-realtime-chat-applicaiton
MIT License
20 stars 8 forks source link

500 - ArgumentCountError - while posting #11

Closed Wadera closed 2 years ago

Wadera commented 2 years ago

Latest version installed via: composer require xelson/flarum-ext-chat:dev-master

Extension can be activated and load all history data from previous version. Chat load correctly, but after post any message - 500 error occur. After refresh website ( F5 / Ctrl + R ) message is visible on the chat correctly. Also chat don't refresh when someone else post message - manual refresh flarum website is required.

$ php flarum info
Flarum core 1.1.1
PHP version: 7.4.3
MySQL version: 5.5.5-10.3.32-MariaDB-0ubuntu0.20.04.1
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcache
+-----------------------------------+------------+--------+
| Flarum Extensions                 |            |        |
+-----------------------------------+------------+--------+
| ID                                | Version    | Commit |
+-----------------------------------+------------+--------+
| ...                               | ...        | ...    |
| xelson-chat                       | dev-master |        |
| kyrne-websocket                   | 3.3.0      |        |
| ...                               | ...        | ...    |
+-----------------------------------+------------+--------+

Error from log / debug:

500

POST https://forum.domain.tdl/api/chatmessages

ArgumentCountError: Too few arguments to function resolve(), 0 passed in /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/PusherWrapper.php on line 41 and at least 1 expected in /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/helpers.php:22

Stack trace:

#0 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/PusherWrapper.php(41): resolve()
#1 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/PusherWrapper.php(70): Xelson\Chat\PusherWrapper->buildPusher()
#2 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/ChatSocket.php(17): Xelson\Chat\PusherWrapper->pusher()
#3 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/Listener/PushChatEvents.php(111): Xelson\Chat\ChatSocket->sendChatEvent()
#4 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/events/Dispatcher.php(404): Xelson\Chat\Listener\PushChatEvents->whenMessageSaved()
#5 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
#6 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/Commands/PostMessageHandler.php(78): Illuminate\Events\Dispatcher->dispatch()
#7 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/bus/Dispatcher.php(122): Xelson\Chat\Commands\PostMessageHandler->handle()
#8 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#9 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#10 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#11 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/illuminate/bus/Dispatcher.php(78): Illuminate\Bus\Dispatcher->dispatchNow()
#12 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/xelson/flarum-ext-chat/src/Api/Controllers/PostMessageController.php(62): Illuminate\Bus\Dispatcher->dispatch()
#13 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(110): Xelson\Chat\Api\Controllers\PostMessageController->data()
#14 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\AbstractSerializeController->handle()
#15 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
#16 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process()
#17 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
#18 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
#19 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
#20 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process()
#21 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
#22 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
#23 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
#24 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
#25 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
#26 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
#27 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
#28 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#29 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
#30 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
#31 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#32 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
#33 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#34 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
#35 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#36 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process()
#37 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#38 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
#39 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#40 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
#41 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
#42 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
#43 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#44 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#45 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
#46 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#47 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
#48 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
#49 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
#50 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#51 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
#52 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#53 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
#54 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
#55 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
#56 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#57 /opt/apache/forum/domains/forum.domain.tdl/flarum/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#58 /opt/apache/forum/domains/forum.domain.tdl/flarum/public/index.php(22): Flarum\Http\Server->listen()
#59 {main}
Xelson commented 2 years ago

probably fixed it. try push and if it doesn't work, then I'll try to install kyrne/websocket and debug it myself

Wadera commented 2 years ago

It's kind of fixed. Working fine in "mobile view" on full screen, but failing on "desktop view": image

Wadera commented 2 years ago

OK, I know what's going one. It's about minimising chat now - look at icon - It's "minimalised".