Closed dltacube closed 6 months ago
Tested locally and it works.
Yep, on my development
branch, sorry... i pushed it last night
Oh ok. Why didn't you use my original PR then?
Oh ok. Why didn't you use my original PR then?
Cuz I had already fixed it before you had submitted the PR
Are you talking about this commit? https://github.com/BlueBubblesApp/bluebubbles-server/commit/2e72faa0ded787f365e5d122bc2f2206f352ec5f
A few of us got around to testing that change and it wasn't emitting websocket messages.
Are you talking about this commit? 2e72faa
A few of us got around to testing that change and it wasn't emitting websocket messages.
But the .bind
code was? cuz they should be essentially doing the same things
Yes, the .bind
code is emitting messages. I'm happy to walk you through how I'm testing this but in brief, I'm looking at the raw network traffic in a terminal. I also assumed your change did the same as the bind
method which is why I didn't jump to test it right away.
Yes, the
.bind
code is emitting messages. I'm happy to walk you through how I'm testing this but in brief, I'm looking at the raw network traffic in a terminal. I also assumed your change did the same as thebind
method which is why I didn't jump to test it right away.
i dont think i need a walkthrough, im just confused why .bind
would work, but the () => ...
wouldn't. Are you 100% positive it's not working, and 100% positive it was working with bind? the handleUpdatedMessage
function was being called for me when I was using the arrow func
Yea 100% sure. Donovon tested it as well independently which is what prompted me to compile that version.
I can't say for sure why one is working and the other isn't but I'm looking into it. I asked you about closures in discord last night :D
Yea 100% sure. Donovon tested it as well independently which is what prompted me to compile that version.
I can't say for sure why one is working and the other isn't but I'm looking into it. I asked you about closures in discord last night :D
So was the handleUpdatedMessage not even called with the closure?
Yea 100% sure. Donovon tested it as well independently which is what prompted me to compile that version. I can't say for sure why one is working and the other isn't but I'm looking into it. I asked you about closures in discord last night :D
So was the handleUpdatedMessage not even called with the closure?
I'd have to look again to be 100% sure since I resorted to running a websocket client and looking at that output. Although I believe I tried arrow functions myself and at the time didn't see the handleUpdateMessage function run at all.
I'm gonna butcher the explanation I'm seeing but arrow functions inherit their this
context while bind
creates their own, presumably by taking a snapshot of the class/instance context. This is why I asked about closures coming into play. Maybe then there is a better fix if we assume that the context shouldn't be changing to the point where arrow functions stop working?
oh i see why... my fault. pushed another update... 🤦
don't tell me you already fixed this on your machine :D