#Events & Listeners depending on shouldDiscoverEvents()
148 messages Β· Page 1 of 1 (latest)
It happens locally right?
what happens locally? the event?
The issue
Can you run php artisan about just want to see if it says your events are cached
Sail might make things weird, never used it.
its been acting great thus far
the socialite discord event is coming through telescope randomly
im not sure if its my discordbot running
or something triggering that
but an event is coming through
but not the KrakenTrade event
i tried to typo the importing events/listener classes to see if an error triggers
but didnt
Not sure I follow what you mean by the discord event, but nothing looks "wrong" to me.
theres 3 events in the listen queue
Registered, socialite discord for oauth, and kraken trade
i mean 3 events in the listen array*
i see SocialiteWasCalled coming through on telescope
Seeing an event being fired in telescope vs a listener are two different things though.
Those events can fire all day whether they are in your array or not.
But you are saying that your attached listeners are never handled unless you turn on auto discovery, which does confuse me.
yeah if autodiscovery is on its all fine
nothing comes through on telescope
only the Socialite event, which was the only event in there before
I do not see what telescope has to do with this
your listeners are either handled or they are not.
isnt it a way to see things happening?
wouldnt events come up through there ?
unless i filter them out
i thought that was the point of telescope
i just saw that telescope was a way to analyze everything so i was hoping it would help me know if these things triggering
This is why I am confused. Do you not have another way to test that your listeners are indeed being handled without relyong on telescope?
Sure, telescope shows events dispatched, and and listeners handled if any
I've never used auto discovery
cause they dont but i guess my test outside of telescope is seeing them work π but is it odd that with autodiscovery on telescope doesnt see them?
no one uses autodiscovery haha
and im stuck using it right now
wild haha
I'd suggest testing another way to actually know your listeners are being ran or not outside of telescope
I mean, at the least, make a new acc and see if you get the email, or a job is on your queue?
Since seems you do not have tests setup for this atm.
Would be easier to try to validate and track down an issue, if any.
Just the class. It is assumed to have handle as the default.
im not sure how id set up a test for this to be honest
Do you have any feature tests setup?
negative
Another time then lol.
haha oof yeah its on a long list
i working on getting an MVP
then can look into hiring some friends/outside devs
Given what you've presented, I can't think of why you would be experiencing an issue, if any. 
yeah im pretty baffled
gonna try rebooting server
havent done that few days
the event gets triggered every few seconds so its like test data is constantly coming in
i see it coming through on soketi, i have a websocket feed coming in with data, so a Ratchet client listens to websocket, when data comes in it triggers the Event
that Event has a Listener.. seems simple, i guess ill use autodiscovery until im pushing to a prod server and see if i have diff results there
maybe ill pry into how autodiscovery works tomorrow
Did you restart your ratchet thing?
yeah
im sure to do that cause the problem you helped me with other day
BroadcastNow
it wouldnt show up there till after i reset that websocket which was running like 3 days
once i had to do that is when i saw my worker queue getting flooded
lol
You kinda went into detail about all this stuff which is only confusing me...a listener is either bound or it is not. So something seems very off here, but I can't focus on what π¦
it is only bound in autodiscovery mode
class EventServiceProvider extends ServiceProvider
{
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
}
WHy not just do this
restart your server
i just did
register, and see if you get the email
ok 1sec
mailhog caught it back when i registered before
so imagine it does
before i pinged for help i went through those classes to see if i matched them, they small files and simple so another reason i got confused
What is only bound in autodiscovery then
As in, does the above work, with no other listeners?
If yes, then what listener does not work with autodiscovery off
Then you might have more to go off of here
no email
i figured the socialite one had to work cause if it isnt there, i cant login via discord
I honestly am not sure.
Driver [discord] not supported.
if that socialite listener isnt there
is there a place where verification email is enabled as well?
outside of the listener?
Ignore that
Why do you have the full class string and handle method defined like that in the first place?
DiscordExtendSocialite::class
well they are linked right on https://laravel.com/docs/9.x/socialite#main-content
you think socialite plugins might be conflicting?
You are going off in the wrong direction too often, please stop.
my b dude
Try the full class import
DiscordExtendSocialite::class
I have zero clue if that has anything to do with your listeners not being bound or not, but idk what is impacting what right now.
Target class [App\Providers\DiscordExtendSocialite] does not exist.
But is it not vendor??
SocialiteProviders\Discord\DiscordExtendSocialite
Why you importing from app namespace
Autodiscovery is off correct?
yes
php artisan event:list | grep Discord
Does the listener show when you run event list
β SocialiteProviders\Discord\DiscordExtendSocialite
Then your $listen array is working as intended. If your listener itself is not "working" you have other issues.
App\Event\Trade ............................................................
shows up as well
but it works in autodiscovery? isnt that odd? want to see the listener?
I came here for a Q about $listen being ignored unless autodiscovery was on. That just is not the case.
Move writing feature tests up the list π
i need to really understand that, ive dabbled at reading docs on it and know its importance
but im confused how it will help me here too
Well for one, you would sure fire know if your events are being dispatched, and if listeners are being called. Two, if your test prove as much and you see issues on your production server, then it's your environment.
so the test would just fire a fake test and the system would see it coming?
But the scope of what you are poking around, and talking about the ratchet server, I have no clue what all is connected to what and in what order/direction. Hence why I'd rather not dig deeper atm lol
Definitely on laracast, though think the test series needs a subscription
its a client
pawl client
Ratchet\Pawl
websocket client
websocket client gets json data -> triggers event that echos that same json data onto local server soketi server -> that event has listeners
pretty basic, but yes enjoy your night man π thanks for assistance again
Yea, brain too fried for me tonight lol. Good luck doe π