Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Fixes Cannot read property 'socketId' of undefined#535

Open
dkulyk wants to merge 1 commit into
tlaverdure:masterfrom
dkulyk:master
Open

Fixes Cannot read property 'socketId' of undefined#535
dkulyk wants to merge 1 commit into
tlaverdure:masterfrom
dkulyk:master

Conversation

@dkulyk

@dkulyk dkulyk commented Jul 28, 2020

Copy link
Copy Markdown

This PR adds check for member and reduce loops find + filter => only filter

On highload projects sometimes I catch:

(node:5114) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'socketId' of undefined
    at /usr/lib64/node_modules/laravel-echo-server/dist/channels/presence-channel.js:74:81
    at Array.filter (<anonymous>)
    at /usr/lib64/node_modules/laravel-echo-server/dist/channels/presence-channel.js:74:31
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

a member is not present on a channel.

@devzom

devzom commented Dec 22, 2021

Copy link
Copy Markdown

Bump , any solution?

@cmcfadden

Copy link
Copy Markdown

bump, would love to see this merged, we encountered this today.

@ulc-brian

ulc-brian commented Jan 31, 2022

Copy link
Copy Markdown
Contributor

We are also having this problem now, the error looks very close to the above and thinking this might fix it. It is basically causing the Laravel Echo server to crash about once a minute where supervisor then restarts it. Here is the stack trace we are getting:

/usr/local/lib/node_modules/laravel-echo-server/dist/channels/presence-channel.js:75
            members = members.filter(function (m) { return m.socketId != member.socketId; });
                                                                                ^

TypeError: Cannot read properties of undefined (reading 'socketId')
    at /usr/local/lib/node_modules/laravel-echo-server/dist/channels/presence-channel.js:75:81
    at Array.filter (<anonymous>)
    at /usr/local/lib/node_modules/laravel-echo-server/dist/channels/presence-channel.js:75:31
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

We are currently using Laravel Echo Server 1.6.2

@cmcfadden

cmcfadden commented Jan 31, 2022

Copy link
Copy Markdown

@ulc-brian if it's helpful, we have a fixed branch we're using at http://github.com/umn-latis/laravel-echo-server, in npm as @umn-latis/laravel-echo-server. We're doing thousands of concurrent connects on it without crashes (knock on wood).

@ulc-brian

Copy link
Copy Markdown
Contributor

Awesome, thanks for that @cmcfadden, I will likely have to do that until this is merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants