apioo / fusio

Open source API management platform
https://www.fusio-project.org
Apache License 2.0
1.87k stars 223 forks source link

Subscription endpoint for system event is not executed #534

Open GNazar opened 10 months ago

GNazar commented 10 months ago

Steps:

  1. Configure system events like it described here https://groups.google.com/g/fusio/c/W4o9kPJceZY
  2. Create subscription for fusio.operation.create, as endpoint specify bean created at https://mockbin.io/
  3. Go to operation and create new operation

Expected: Create event is described in Subscription section Event payload logged at mockbin

Got: Create event is described in Subscription section, status pending. No record at mockbin. Error in logs:

PHP Fatal error:  Uncaught Error: Typed property PSX\Record\Record::$properties must not be accessed before initialization in /var/www/html/fusio/vendor/psx/record/src/Record.php:90
Stack trace:
#0 /var/www/html/fusio/vendor/psx/record/src/Record.php(242): PSX\Record\Record->getAll()
#1 [internal function]: PSX\Record\Record->__serialize()
#2 /var/www/html/fusio/vendor/symfony/messenger/Transport/Serialization/PhpSerializer.php(61): serialize()
#3 /var/www/html/fusio/vendor/symfony/doctrine-messenger/Transport/DoctrineSender.php(39): Symfony\Component\Messenger\Transport\Serialization\PhpSerializer->encode()
#4 /var/www/html/fusio/vendor/symfony/doctrine-messenger/Transport/DoctrineTransport.php(72): Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineSender->send()
#5 /var/www/html/fusio/vendor/symfony/messenger/EventListener/SendFailedMessageForRetryListener.php(81): 
chriskapp commented 10 months ago

Hi @GNazar ok this looks like it is a problem if you put a PSX\Record\Record instance in the queue. I have just released a new version v3.0.6 of https://github.com/apioo/psx-record which should fix this problem, if its possible try to run composer update psx/record to install the latest version

GNazar commented 10 months ago

Cool! Thank you!

Will try that. I there any plans to include that fix into docker image?