UMN-LATIS / ChimeIn2.0

Live polling and quizzes for engaging presentations, complete with LTI integration
https://chimein.cla.umn.edu
3 stars 0 forks source link

Sometimes Laravel Echo Server crashes #728

Closed jxjj closed 1 year ago

jxjj commented 1 year ago

When running cypress tests locally, I noticed that often Laravel Echo Server will crash during the tests.

For example, running cypress question.test.js, the Echo Server will exit with a log something like:

2023-09-18 16:20:21 [2023-09-18T21:20:21.603Z] - Preparing authentication request to: http://app
2023-09-18 16:20:21 [2023-09-18T21:20:21.603Z] - Sending auth request to: http://app/broadcasting/auth
2023-09-18 16:20:21 
2023-09-18 16:20:21 [2023-09-18T21:20:21.635Z] - 7KMPqmCqFXrvXpBwAAAH left channel: presence-session-status.4 (unsubscribed)
2023-09-18 16:20:21 [2023-09-18T21:20:21.635Z] - 7KMPqmCqFXrvXpBwAAAH left channel: private-session-response.4 (unsubscribed)
2023-09-18 16:20:21 /usr/local/share/.config/yarn/global/node_modules/laravel-echo-server/dist/channels/presence-channel.js:79
2023-09-18 16:20:21                     delete member.socketId;
2023-09-18 16:20:21                     ^
2023-09-18 16:20:21 
2023-09-18 16:20:21 TypeError: Cannot convert undefined or null to object
2023-09-18 16:20:21     at /usr/local/share/.config/yarn/global/node_modules/laravel-echo-server/dist/channels/presence-channel.js:79:21
2023-09-18 16:20:21     at processTicksAndRejections (node:internal/process/task_queues:96:5)

This issue occurs for me on both the develop branch, the WIP dependency update (Laravel 10) branch.

Despite this, cypress tests continue to pass (which is probably it's own issue).

cmcfadden commented 1 year ago

I think that’s the issue we’ve fixed in our prod version of echo server: https://github.com/umn-latis/laravel-echo-server

jxjj commented 1 year ago

I thought it seemed familiar. Since it only affects development, I'll just add an auto restart to the docker-compose.