Coder Social home page Coder Social logo

laravel-wave's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar slavarazum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-wave's Issues

[Bug]: Error when running php artisan install:broadcasting

What happened?

Error Exception after Published 'channels' route file.

copy(/Users/project/mylaravelproject/vendor/qruto/laravel-wave/src/Console/Commands/../../../vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/broadcasting-routes.stub): Failed to open stream: No such file or directory

How to reproduce the bug

  1. install laravel
  2. Run composer require qruto/laravel-wave
  3. Run php artisan install:broadcasting

Package Version

0.9

PHP Version

8.2.14

Laravel Version

11.2.0

Which operating systems does with happen with?

macOS

Notes

I suggest in BroadcastingInstallCommand.php do not using relative paths to copy stubs. instead using basepath to the stub file.

Thank you.

[Bug]: Can't broadcast to presence channel

What happened?

I'm trying to broadcast to a presence channel and I'm not seeing anything sent/received.

How to reproduce the bug

I have a model set up to broadcast on changes:

    public function broadcastOn(string $event): array
    {
        return match ($event) {
            'created' => [new PresenceChannel('chat.'.$this->receiver_id)],
            default => [],
        };
    }

I have auth set up in channels.php, which seems to work (no 403 errors in console):

Broadcast::channel('chat.{user}', function (User $user, User $receiver) {
    if ($user->id === $receiver->id) {
        return ['id' => $user->id, 'name' => $user->name];
    }

    return false;
});

I added this to my app.js:

Echo.join('chat.3')
    .here(() => {
        console.log('here');
    })
    .joining(() => {
        console.log('joining');
    })
    .leaving(() => {
        console.log('leaving');
    })
    .listen('MessageCreated', (e) => {
        console.log('listening')
    });

And I don't see the listening in my console.log, only here.

Package Version

0.7.1

PHP Version

8.2.8

Laravel Version

10.19

Which operating systems does with happen with?

macOS

Notes

I will see if I can figure out a failing test for this, but I did notice there were no presence tests.

[Bug]: Unable to prepare route

What happened?

when you type the php artisan optimize command

How to reproduce the bug

php artisan optimize

Package Version

0.8.0

PHP Version

8.2.0

Laravel Version

10.28

Which operating systems does with happen with?

Linux

Notes

Screenshot_38

[Bug]: Live demo has an expired SSL certificate

What happened?

Accessing https://wave.qruto.dev/ gives an error as its SSL certificate expired on Feb 7th, 2024

Screenshot_20240210_153345

How to reproduce the bug

Access https://wave.qruto.dev/ from a browser

Package Version

0.8.1

PHP Version

8.2.15

Laravel Version

10.43.0

Which operating systems does with happen with?

Linux

Notes

I wasn't sure how to contact you about this, but thought you'd like to know. Thanks for this package, works like a charm.

No error gets thrown when the PHP Redis extension is disabled

Usually, Laravel throws an error when the PHP Redis extension is disabled. It will show you the following message:

Please make sure the PHP Redis extension is installed and enabled.

Setting the BROADCAST_DRIVER to redis and having the PHP Redis extension disabled will not output this message. I did a fresh install of my PC and forgot to enable the PHP Redis extension, leading to running around for a while when no errors were getting thrown.

[Bug]: Not working with predis

What happened?

I use predis and there seems to be a difference with the interface.

[2024-03-13 13:22:45] production.ERROR: ERR wrong number of arguments for 'xdel' command {"exception":"[object] (Predis\\Response\\ServerException(code: 0): ERR wrong number of arguments for 'xdel' command at /path/vendor/predis/predis/src/Client.php:416)
[stacktrace]
#0 /path/vendor/predis/predis/src/Client.php(385): Predis\\Client->onErrorResponse()
#1 /path/vendor/predis/predis/src/Client.php(335): Predis\\Client->executeCommand()
#2 /path/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(116): Predis\\Client->__call()
#3 /path/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(216): Illuminate\\Redis\\Connections\\Connection->command()
#4 /path/vendor/qruto/laravel-wave/src/Storage/BroadcastEventHistoryRedisStream.php(65): Illuminate\\Redis\\Connections\\Connection->__call()
#5 /path/vendor/qruto/laravel-wave/src/Storage/BroadcastEventHistoryRedisStream.php(46): Qruto\\Wave\\Storage\\BroadcastEventHistoryRedisStream->removeOldEvents()
#6 /path/vendor/qruto/laravel-wave/src/BroadcastManagerExtended.php(30): Qruto\\Wave\\Storage\\BroadcastEventHistoryRedisStream->pushEvent()
#7 /path/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(84): Illuminate\\Broadcasting\\Broadcasters\\RedisBroadcaster@anonymous->broadcast()
#8 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Broadcasting\\BroadcastEvent->handle()
#9 /path/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#10 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#11 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#12 /path/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\\Container\\BoundMethod::call()
#13 /path/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#14 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#15 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /path/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#17 /path/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Bus\\Dispatcher->dispatchNow()
#18 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#19 /path/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /path/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#21 /path/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#22 /path/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#23 /path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(425): Illuminate\\Queue\\Jobs\\Job->fire()
#24 /path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(375): Illuminate\\Queue\\Worker->process()
#25 /path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(326): Illuminate\\Queue\\Worker->runJob()
#26 /path/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(147): Illuminate\\Queue\\Worker->runNextJob()
#27 /path/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(130): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#28 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#29 /path/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#30 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#31 /path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#32 /path/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\\Container\\BoundMethod::call()
#33 /path/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call()
#34 /path/vendor/symfony/console/Command/Command.php(312): Illuminate\\Console\\Command->execute()
#35 /path/vendor/laravel/framework/src/Illuminate/Console/Command.php(152): Symfony\\Component\\Console\\Command\\Command->run()
#36 /path/vendor/symfony/console/Application.php(1022): Illuminate\\Console\\Command->run()
#37 /path/vendor/symfony/console/Application.php(314): Symfony\\Component\\Console\\Application->doRunCommand()
#38 /path/vendor/symfony/console/Application.php(168): Symfony\\Component\\Console\\Application->doRun()
#39 /path/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
#40 /path/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(155): Illuminate\\Console\\Application->run()
#41 /path/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#42 {main}
"} 

and

production.ERROR: Array to string conversion {"userId":1,"exception":"[object] (ErrorException(code: 0): Array to string conversion at /path/vendor/predis/predis/src/Connection/StreamConnection.php:368)
[stacktrace]
#0 /path/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /path/vendor/predis/predis/src/Connection/StreamConnection.php(368): strval()
#3 /path/vendor/predis/predis/src/Connection/AbstractConnection.php(122): Predis\\Connection\\StreamConnection->writeRequest()
#4 /path/vendor/predis/predis/src/Client.php(381): Predis\\Connection\\AbstractConnection->executeCommand()
#5 /path/vendor/predis/predis/src/Client.php(335): Predis\\Client->executeCommand()
#6 /path/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(116): Predis\\Client->__call()
#7 /path/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(216): Illuminate\\Redis\\Connections\\Connection->command()
#8 /path/vendor/qruto/laravel-wave/src/Storage/BroadcastEventHistoryRedisStream.php(54): Illuminate\\Redis\\Connections\\Connection->__call()
#9 /path/vendor/qruto/laravel-wave/src/Sse/ServerSentEventStream.php(70): Qruto\\Wave\\Storage\\BroadcastEventHistoryRedisStream->pushEvent()
#10 /path/vendor/laravel/framework/src/Illuminate/Support/helpers.php(306): Qruto\\Wave\\Sse\\ServerSentEventStream->Qruto\\Wave\\Sse\\{closure}()
#11 /path/vendor/qruto/laravel-wave/src/Sse/ServerSentEventStream.php(67): tap()
#12 /path/vendor/symfony/http-foundation/StreamedResponse.php(92): Qruto\\Wave\\Sse\\ServerSentEventStream->Qruto\\Wave\\Sse\\{closure}()
#13 /path/vendor/symfony/http-foundation/Response.php(377): Symfony\\Component\\HttpFoundation\\StreamedResponse->sendContent()
#14 /path/public/index.php(67): Symfony\\Component\\HttpFoundation\\Response->send()
#15 /path/server.php(26): require_once('...')
#16 {main}

The order of xadd is not the same for phpredis and predis:
phpredis xadd:
https://github.com/phpredis/phpredis?tab=readme-ov-file#xadd
predis xadd:
https://github.com/predis/predis/blob/45b18eb2e06c7e1b3aaf98eb99e247ae0eb3ec0d/src/ClientInterface.php#L278

Possible fix for:

$id = $this->db->xAdd('broadcasted_events', '*', $eventData);

if($this->db instanceof PhpRedisConnection){
    $id = $this->db->xAdd('broadcasted_events', '*', $eventData);
}else{
    $id = $this->db->xAdd('broadcasted_events', $eventData, '*');
}

And xDel does not work with an empty array.

Possible fix for: https://github.com/qruto/laravel-wave/blob/d304c96b4a9326654fd5c6e42c7ce6243f147e52/src/Storage/BroadcastEventHistoryRedisStream.php#L65C9-L65C72

if(count($oldEvents) === 0){
    return;
}
$this->db->xDel('broadcasted_events', \array_keys($oldEvents));

How to reproduce the bug

  • Install the package as suggested in the README file.
  • Install predis (I used v2.2.2)
  • change laravel config database.redis.client to predis

Package Version

0.8.1

PHP Version

8.2.10

Laravel Version

v9.52.7

Which operating systems does with happen with?

Linux

Notes

No response

[Bug]: same route name error when use artisan optimize

What happened?

same route name error
when use optimize

How to reproduce the bug

when use

php artisan optimize

it shows

  LogicException 

  Unable to prepare route [wave/presence-channel-users] for serialization. Another route has already been assigned name [wave.presence-channel-users].

  at vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:247
    243▕             $route->name($this->generateRouteName());
    244▕ 
    245▕             $this->add($route);
    246▕         } elseif (! is_null($symfonyRoutes->get($name))) {
  ➜ 247▕             throw new LogicException("Unable to prepare route [{$route->uri}] for serialization. Another route has already been assigned name [{$name}].");
    248▕         }
    249▕ 
    250▕         $symfonyRoutes->add($route->getName(), $route->toSymfonyRoute());
    251▕ 

      +34 vendor frames 

  35  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Package Version

"qruto/laravel-wave": "^0.6.0",

PHP Version

8.2.1

Laravel Version

10.7.1

Which operating systems does with happen with?

Windows

Notes

No response

[Bug]: Octane compatibility does not work!

What happened?

I'm trying to connect laravel octane with laravel wave! however, it is repeating the GET requests for /wave in the console!

I'm using laradock + laravel octane + swoole!
pecl -q install swoole-4.8.12

roadrunner the same thing happens too!

How to reproduce the bug

install laradock + swoole + laravel wave

Package Version

0.8.0

PHP Version

8.2.0

Laravel Version

10.28

Which operating systems does with happen with?

Linux

Notes

Screenshot_39

[Bug]: Vite exception for the new laravel npm module setup

What happened?

Your package is among a lot of packages that got affected by the new module type in packages.json:
https://github.com/laravel/laravel/blob/84991f23011dfde4bc3ae3db04343c3afb3bc122/package.json#LL3C22-L3C22

Laravel-Wave now throws this exception:

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/laravel-wave.js?v=f42660d9' does not provide an export named 'default' (at echo.js:9:8)

How to reproduce the bug

Just install it in a new Laravel project, I guess?!

Package Version

^0.7.1

PHP Version

8.1.7

Laravel Version

10.13.5

Which operating systems does with happen with?

Linux

Notes

I'm using the TALL stack. (blade preset with Laravel Breeze)

[Bug]: net::ERR_HTTP2_PROTOCOL_ERROR 200

What happened?

Cannot connect with wave. error with this net::ERR_HTTP2_PROTOCOL_ERROR 200 on HTTP/2 and net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) on HTTP/1.1 on console

How to reproduce the bug

Installation process shown on github repo and see in console

Package Version

0.7.1

PHP Version

8.2.8

Laravel Version

10.15.0

Which operating systems does with happen with?

macOS, Linux

Notes

No response

[Bug]: Can't connect to private channels!

What happened?

In previous versions of laravel-wave when connecting to a private channel a request is made to /broadcasting/auth and a body is sent:

socket_id: xxxxxx.xxxxxx
channel_name: private-user.1

in the new version of laravel wave it is not possible to connect to a private channel! probably because it doesn't send a request to /broadcasting/auth

How to reproduce the bug

window.EchoWave = new Echo({
   broadcaster: WaveConnector,
   debug: true,
   endpoint: '/wave',
   authEndpoint: '/broadcasting/auth',
 })

when connecting to a private channel it automatically makes a request for /broadcasting/auth! what is not happening at the moment! this way it is not possible to receive events in private channels

 window.Echo.private('user.1').listen('RealTimeNotification', e => {
   console.log('Echo user 1 Private ', e.message)
 })
 window.Echo.private('user.2').listen('RealTimeNotification', e => {
   console.log('Echo user 2 Private ', e.message)
 })
 window.Echo.channel('events').listen('RealTimeNotification', e => {
   console.log('Echo ', e.message)
 })

Package Version

0.7.0

PHP Version

8.2.0

Laravel Version

10.10

Which operating systems does with happen with?

Linux

Notes

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.